LWN.net Logo

GCC Explorer - an interactive take on compilation

GCC Explorer - an interactive take on compilation

Posted May 24, 2012 17:04 UTC (Thu) by rriggs (subscriber, #11598)
In reply to: GCC Explorer - an interactive take on compilation by Richard_J_Neill
Parent article: GCC Explorer - an interactive take on compilation

How would you optimize that code with

#define X "42"

or maybe

printf ("This string shows a runtime value: %s\n", 42);

instead?

I suppose you could let the compiler crash rather than creating a buggy program...


(Log in to post comments)

GCC Explorer - an interactive take on compilation

Posted May 27, 2012 8:08 UTC (Sun) by mb (subscriber, #50428) [Link]

GCC throws a warning for this, if sane warning flags are used.

GCC Explorer - an interactive take on compilation

Posted May 28, 2012 12:39 UTC (Mon) by jwakely (subscriber, #60262) [Link]

Am I the only person who dislikes the increasingly-common use of "throw" to describe anything vaguely related to errors, but nothing to do with exceptions?

GCC Explorer - an interactive take on compilation

Posted May 30, 2012 4:43 UTC (Wed) by jzbiciak (✭ supporter ✭, #5246) [Link]

Is it really all that recent? I think there are plenty of parallels outside computing. Children have been throwing tantrums forever, for example, and people throw their backs out all the time. Cars don't throw a rod very often any more (though mine did about a year ago). I'm sure we've all been really thrown by something unexpected. In all of these, something bad (or at least unusual) has been thrown your way.

So, "throw an error" without having anything to do with the very specific notion of exceptions? Not too different than throwing a fit, really, except that we like our compilers to be fussy, at least to a certain extent.

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