This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch -Wtraditional, numeric constant suffix warnings (take 2)


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]