avr-gcc-list
[Top][All Lists]
Advanced

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

[avr-gcc-list] avr-gcc does not throw diagnostics on undefined escape se


From: Jan Waclawek
Subject: [avr-gcc-list] avr-gcc does not throw diagnostics on undefined escape sequences
Date: Thu, 17 May 2012 08:47:59 +0200

Originated from discussion at 
http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=120970 

The following code:

#include <stdio.h>

int a = 1;
int b = 1;
int c = 1;
int d = 1;
int e = 1;
int f = 1;

char buffer[30];

int main(void) {
  sprintf(buffer, "\%d/\%d/\%02d \%d:\%02d:\%02d", a, b, c, d, e, f);
  printf(buffer);
}


compiles cleanly with avr-gcc (I tried both 4.2.2 and 4.7.1), even with 
-std=c99.

My understanding of C99, 6.4.4.4, especially footnote 65, indicates, that the 
\% sequence should result in compiler error.

Comments, please?

Jan Waclawek




reply via email to

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