This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
NDEBUG-like macro
- To: egcs at cygnus dot com
- Subject: NDEBUG-like macro
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Wed, 15 Apr 1998 14:59:41 -0700
- Reply-to: mmitchell at usa dot net
Folks --
In private email, Jeff and I have been discussing the following
proposal:
o Add a configuration option --enable-checking to enable additional,
possibly costly, consistency checks in the compiler.
o This option would cause the definition of the macro ENABLE_CHECKING
throughout compilation of the compiler.
o Then, we could add checks in the compiler that are only enabled
if ENABLE_CHECKING.
The motivation for this is the disturbingly common situation in
which I find that bugs are triggered by using, say, DECL_INITIAL on a
tree node that is not a DECL. In general, the use of a macro that
pulls something out of a tagged union when the tag doesn't match. It
would be nice if we could blow up when we did this wrong.
Unfortunately, checking this everywhere will be quite costly; so much
so that we should not do it when a normal user is using the compiler.
Hence the need for a compile-time option.
Jeff said:
> I'm got no particular problem with this, though I'd like to see
> it at least mentioned on the list so that Jim, Jason, etc can
> comment.
So, comment away!
--
Mark Mitchell <mmitchell@usa.net>
http://home.earthlink.net/~mbmitchell
Consulting Services Available