LWN.net Logo

GCC Explorer - an interactive take on compilation

GCC Explorer - an interactive take on compilation

Posted May 25, 2012 2:59 UTC (Fri) by daglwn (subscriber, #65432)
In reply to: GCC Explorer - an interactive take on compilation by njs
Parent article: GCC Explorer - an interactive take on compilation

By "inherently unsafe," I mean the compiler would arguably make a transformation that causes wrong results. That's certainly not what the programmer expects.


(Log in to post comments)

GCC Explorer - an interactive take on compilation

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.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds