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: Add warnings for #directives with indented #


 > From: Zack Weinberg <zack@wolery.cumb.org>
 > 
 > On Mon, Apr 03, 2000 at 11:50:16AM -0400, Kaveh R. Ghazi wrote:
 > >  > From: Zack Weinberg <zack@wolery.cumb.org>
 > >  > 
 > >  > On Sun, Apr 02, 2000 at 10:44:25AM -0400, Kaveh R. Ghazi wrote:
 > >  > > One more thing, bootstrapping gcc gives some of these warnings which
 > >  > > I think should be avoided.
 > >  > > Why isn't gcc/include being treated as a [system] include dir 
 > >  > > in the above?
 > >  > 
 > >  > Because the system include dirs are hardwired by pathname.  It'll be
 > >  > a system include dir after installation.
 > ...
 > > I don't think we need Makefile hackery, this is a more general
 > > problem.  I would have thought that the -B flag would pass -isystem to
 > > cpp.  (All of these cases got a -B right?)
 > 
 > -B./ does not automatically translate to -isystem ./include and I
 > don't think it should.  There may not be a ./include, or it may
 > contain something you don't want to use.  Also, -isystem will put the
 > directory after all the -I directories in the search path, which is
 > probably wrong in this case.
 > 
 > > IMHO, we shouldn't fix these system include header warnings in the
 > > gcc/include dir.  We should instead teach cpp that these are system
 > > headers via the -B flag and the problem goes away via the established
 > > mechanism.
 > > 
 > > Note, cc1 needs to know this info also for all the warnings it avoids
 > > on system headers.
 > 
 > Better to write our headers so they don't trigger warnings in the
 > first place, IMO.
 > zw

True.  However what if the header wasn't written by us, but instead
got copied from the system area as part of the fixincludes process?
Then we would get these warnings e.g. for all non-indented #pragmas
when building gcc.

Also, how does this affect the recent fix you made for implicit extern
"C" on system headers?  Don't you have to know that the files in the
gcc/include dir are system headers in order to do the implicit extern
"C" on them?

		--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]