[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] avr-gcc does not throw diagnostics on undefinedescape

From: Jan Waclawek
Subject: Re: [avr-gcc-list] avr-gcc does not throw diagnostics on undefinedescape sequences
Date: Thu, 17 May 2012 14:52:22 +0200

>const char c[] = "\%";
>$ 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,, especially footnote 65, indicates,
>> that the \% sequence should result in compiler error.
>> Comments, please?
>Read "C Dialect Options" and what -std=c99 means

Indeed. So, this particular "error" is revealed only if -pedantic-whatever is 

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 

Two new things learned today... :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]