By "inherently unsafe," I mean the compiler would arguably make a transformation that causes wrong results. That's certainly not what the programmer expects.
Posted May 25, 2012 12:47 UTC (Fri) by njs (guest, #40338)
[Link]
printf's behavior is defined in the C standard, just like the rest of the language. Any optimization the compiler does to anything, ever, might arguably make a transformation that causes wrong results. Such things are just called "compiler bugs"...
GCC Explorer - an interactive take on compilation
Posted May 25, 2012 14:25 UTC (Fri) by BenHutchings (subscriber, #37955)
[Link]
No, the use of a LD_PRELOAD library which wraps printf() and not puts() is the invalid transformation.