This is the mail archive of the
mailing list for the GCC project.
RFE: 'enable checking' as a GCC compilation switch?
- From: Gary Funck <gary at intrepid dot com>
- To: GCC List <gcc at gcc dot gnu dot org>
- Date: Sun, 3 Oct 2010 11:34:41 -0700
- Subject: RFE: 'enable checking' as a GCC compilation switch?
Recently, I ran into a couple of bugs/regessions that show up
only if checking is enabled. This led me to the observation that
it might be useful if checking can be enabled at runtime via a
gcc command line switch. If this capability can be enabled by
default, then regression tests could depend upon the checking
capability, or users could be asked to run with full checks
enabled when reporting bugs, etc.
There will be some overhead to test for the switch, though the
code that does the checking might remain under an #ifdef as it
does now, to ensure that it absolutely isn't compiled unless the
appropriate configuration option is enabled. That said, I would
argue that if we go to the trouble to implement the capability,
then support for checking switches should be enabled by default.
If the code is never conditionalized, then --enable-checking=xxx
might be re-defined to assert the various checking flags by default.
Here is are some quick stats on the use/frequency of
various checking options in GCC:
Certainly, plenty of them to deal with, but perhaps with a bit of
scripting the bulk of the changes can be automated.