LWN.net Logo

GCC 4.6.0 released

GCC 4.6.0 released

Posted Jul 18, 2011 10:03 UTC (Mon) by runciter (guest, #75370)
In reply to: GCC 4.6.0 released by etienne
Parent article: GCC 4.6.0 released

How about:

enum DebugFlags {
  DEBUG_INPUT = 0,
  DEBUG_SOMETHING_ELSE = 1,
};

It's constant, doesn't use any memory and doesn't use the preprocessor.


(Log in to post comments)

GCC 4.6.0 released

Posted Jul 18, 2011 13:12 UTC (Mon) by etienne (subscriber, #25256) [Link]

But it is not as "structured" as a C structure named "debug" which would contain not only boolean but where to send the ouput (stdout, stderr, serial, filename...) and sub-structures like what to debug in "INPUT".
Anyway GCC-4.6 does introduce the inlining of constants, if you want a read only variable modified in the ELF file or at assembly time before main() is called, you now need to use "volatile const" - I was too quick to do that initial comment...

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