>const char c[] = "\%"; > >compile > >$ gcc file.c -std=c99 -fsyntax-only -pedantic-errors > >file.c:1:18: unknown escape sequence '\%' > >Tested with gcc 3.4 and gcc 4.7 > >> My understanding of C99, 6.4.4.4, especially footnote 65, indicates, >> that the \% sequence should result in compiler error. > >Yes. > >> Comments, please? > >Read "C Dialect Options" and what -std=c99 means > >http://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html >
Indeed. So, this particular "error" is revealed only if -pedantic-whatever is used. One learns something new every day. Thanks, Johann. Meantime, I also consulted the Derek Jones book, which for this particular issue says, among other interesting things, this: "It is possible that an occurrence of such a character sequence will cause a violation of syntax to occur, which will in turn require a diagnostic to be generated. However, implementations are not required to issue a diagnostic just because a footnote (which is not non-normative) says one is required." Two new things learned today... :-) Jan _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list