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


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to