This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch -Wtraditional, numeric constant suffix warnings (take 2)
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch -Wtraditional, numeric constant suffix warnings (take 2)
- From: Zack Weinberg <zack at wolery dot cumb dot org>
- Date: Wed, 9 Aug 2000 21:29:36 -0700
- Cc: gcc-patches at gcc dot gnu dot org, meissner at cygnus dot com, rearnsha at arm dot com, rth at cygnus dot com
- References: <200008092032.QAA06821@caip.rutgers.edu>
On Wed, Aug 09, 2000 at 04:32:39PM -0400, Kaveh R. Ghazi wrote:
>
> Zack regarding your suggestion of extending cpp to mark where macros
> were defined and elide these if the macro came from a system header,
> is that something a non-cpplib expert can do quickly or is it very
> involved? (The other option is to simply not teach cpp about this
> warning.)
It should be easy to do. Add a pointer to 'struct include_hash' to
struct cpp_hashnode. In _cpp_create_definition, set that pointer
equal to CPP_BUFFER (pfile)->inc. Then augment the definition of
CPP_IN_SYSTEM_HEADER() [in cpphash.h] so that it checks the context
stack as well as the current input buffer. The context stack is in
cpplex.c - you may have to hoist the data structure declarations up
into cpphash.h so they're visible. I'm not sure what the right
context-stack check is. The macro expander is, um, clever, and I
didn't write it.
And add a bunch of test cases.
zw