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]
Other format: [Raw text]

Re: gcc 3.2's cpp breaks configure scripts



The gcc warning is correct in the cases that I have examined.  I don't
believe that configure should be adding include directories to CPPFLAGS
that are already being searched as system directories by gcc.  This
changes the include search order as noted in the warning and may
cause unexpected results.
configure shouldn't, quite ture. The warning is correct in that its 'just' a warning. On the otherhand I feel that the warning could be tightened significantly, or that the compiler could 'do the right thing' anyway unless it was specifically given a flag to ignore that. I am guessing theres very little chance of the last one, but I dont really see why the warning couldnt be limited to 'including a fixinclude header' or 'cross-compiling' or (insert other special cases i dont know?). I fail to see how other cases need a 'mandatory' warning - maye an optional one...
My idea is
if -I internal header directory
check for -Wbad-include - if yes then output warning
check for if compiler is cross-compiler - if yes then output warning
Start preprocessing - if #include/(other include type extensions) and target is in fixincludes list - output warning.
<add additional rules here for any other special cases>

One of the culprits in this regard is lib-prefix.m4 (gettext-0.11).
Bruno Haible feels that the solution is to install gcc in a unique
location not used for other packages.  However, this is not recommended
or discussed in the gcc installation notes.  I feel that this is like
confining gcc to the barn.  I like the fact that gcc automatically
searches ${prefix}/include and links in libraries in ${prefix}/lib.
I agree here.
Possibly, if gcc provided a simpler way to print the search order,
the autoconf macro authors could be persuaded not to append these
directories to CPPFLAGS.  The reasons to do this are documented.
I would hope it would help...

Turning the warning off is not the correct solution, although there
may be some circumstances in which it is emitted when it shouldn't
be.
I think so... but I am probably wrong hehe...

Gareth


_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com


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