\0 in strings

Horst von Brand vonbrand@sleipnir.valparaiso.cl
Sun Feb 27 10:22:00 GMT 2000


Per Hedbor <per@idonex.se> said:
> The newest snapshot version of gcc gives errors when it encounters a ÿ
> after encountering a \0 in a string:
> 
> test.c:1: Unterminated string constant
> test.c:2: Unterminated string constant
> test.c:2: parse error at end of input
> 
> The whole contents of 'test.c' is:
> unsigned char *f = "\0ÿ";

What machine is this? ÿ is what I see when somebody tries to print an EOF,
so this is probably working in reverse somewhere.

In any case, I see the same here (egcs-20000221, glibc-2.1.3 on
i686-redhat-linux). egcs-1.1.2-24 and gcc-2.95.2 work fine.
-- 
Horst von Brand                             vonbrand@sleipnir.valparaiso.cl
Casilla 9G, Viña del Mar, Chile                               +56 32 672616



More information about the Gcc-bugs mailing list