This is the mail archive of the gcc@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: "introduce no new bootstrap warning" criteria. was: Loop iv debugging, patch


 > From: Neil Booth <neil@daikokuya.demon.co.uk>
 > 
 > Geoff Keating wrote:-
 > 
 > > Or perhaps the macro expander should track which macros are defined in
 > > system headers and not produce warnings for them?
 > 
 > I'm not a fan of this option at all.  The only warnings we can avoid
 > this way are CPP warnings about the macro definition, which one
 > would hope was valid anyway being in a system header.
 > 
 > When it comes to usage, it gets really hairy because the invocation of
 > the macro could have come from other macros or macro arguments,
 > recursively who is to know whether those tokens come from user code or
 > system headers?  And to the front ends, tokens all look the same
 > regardless of whence they came.

I'm not sure its as hairy as you suggest, Zack seemed to think it
could be done.  See my previous posting on this topic which contains
references to his opinions from August.
http://gcc.gnu.org/ml/gcc/2001-01/msg00886.html


 > Zack showed Ulrich how to fix glibc to avoid the warning, and was
 > rudely brushed off.
 > Neil.

Well that aside, we still have problems with proprietary vendors whose
system header macros produce warnings when utilized in user code.

Geoff suggested fixincludes, but it would be a real pain to fix every
macro that could potentially cause problems.  And some cases are a
catch-22, e.g. what about UINT_MAX which contains a U suffix?  Using
UINT_MAX in user code causes -Wtraditional to complain about the U,
but without the U you get "decimal constant is so large it is
unsigned" problems.  (Not that I would recommend getting rid of the U,
just that either way we're hosed.)

The only solution to this kind of problem IMHO is to teach gcc to
ignore warnings from macros defined in system headers.  Zack outlined
a way to do this given an integrated preprocessor, is it still
workable given all the changes to the cpp infrastructure since August?

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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