This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/83557] missing last char in printf fmt string


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83557

--- Comment #2 from m68k <x37a5709 at gmail dot com> ---
Thanks for the feedback of this forgotten/unexpected behavior.

The funny part of this is, that the rules are not easy to adopt


see what printf("%c\r\n", 'A'); 

   5                    .LC1:
   6 0002 25630D0A              .string "%c\r\n" <--printf("%c\r\n", 'A'); 
   6      00
HERE \n is maintained, not taking into account puts behavior!!


\n is also maintained in some semantic wrong but syntax correct statement
see:

printf("\r\n");   with printf("\r\n", ' ');

   3                    .LC0:
   4 0000 0D00                  .string "\r"      <---printf("\r\n"); 
   5                    .LC1:
   6 0002 0D0A00                .string "\r\n"    <---printf("\r\n", ' ');



and \n is also maintained when \n not at the end of a string
and see what printf("\n\r"); 

  11                    .LC4:
  12 000d 0A0D00                .string "\n\r"  <---printf("\n\r)");

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]