C++ translation improvement

Zack Weinberg zack@codesourcery.com
Mon Apr 7 09:34:00 GMT 2003

Jason Merrill <jason@redhat.com> writes:

> On Sun, 06 Apr 2003 18:52:51 -0700, Zack Weinberg <zack@codesourcery.com> wrote:
>> The last time I posted it, someone pointed out that the indentation
>> logic is broken for non-unibyte character sets, but I don't see any
>> way to do it correctly with the existing API. It can be fixed in a
>> follow-up patch if someone figures out how.
> Would %n be useful?

I don't think so - the spec for %n says 'stores the number of
characters written', when what we want is the width in columns
of the string.

wcswidth(mbstowcs(str)) is the number really wanted -- except that we
can't count on those functions being present, and even if we could, we
can't count on str being in the character set mbstowcs expects.


More information about the Gcc-patches mailing list