This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: __STRICT_ANSI__ "fixes" on STDC_0_IN_SYSTEM_HEADERS (solaris) targets
> > However I believe since fixincludes moved to the top level
> > directory we're no longer looking in the target headers and getting
> > that definition and thus the __STRICT_ANSI__ changes are always
> > applied, even when they're not supposed to be.
> > Am I reading the situation correctly?
>
> I don't know. We only have a couple of Solaris platforms where I
> work and they (mostly) aren't configured to build anything. This
> means it isn't easy for me to chase this down. I would hazard a
> guess, though, that the change is at least innocuous or there would
> have been complaints by now. :)
The problems fixed by STDC_0_IN_SYSTEM_HEADERS certainly are not
showstoppers. The fact that fixincludes no longer honors it is not a
huge deal, but the bug will trigger under the right set of unique
circumstances. It was apparently enough of a problem at one point to
create the STDC_0_IN_SYSTEM_HEADERS hack in the first place.
First of all the problem only occurs on those systems which set
STDC_0_IN_SYSTEM_HEADERS, that means solaris and interix according to
my grep results below. Second you must be using gcc-4.0 or later,
namely those gcc versions where fixincludes was moved to the top
level. Third, you must use gcc with -ansi. Fourth, you must use one
of the problematic headers in your source code which was broken with
__STDC__==1.
> config/interix.h:#define STDC_0_IN_SYSTEM_HEADERS 1
> config/sol2.h:#define STDC_0_IN_SYSTEM_HEADERS 1
Over time, sun fixed some of these problems, so e.g. solaris10 will
see less breakage than older OS versions. I don't know the situation
on interix. I think it's been hidden so far because not every solaris
user has 4.x installed and later solaris versions minimize the
problem. And of course not everyone uses -ansi or -std=c89, etc.
Recently I know that e.g. this affected Eric on 2.5.1. It occurs with
pthread.h. That's partly how I realized this problem existed: he was
helping me by testing my pthread testcase on various solaris versions,
and the testcase failed on 2.5.1 with -ansi.
> Anyway, is there a way to
> determine the setting for STDC_0_IN_SYSTEM_HEAD at run time, since
> not for compile time? That'd fix it.
> Thanks - Bruce
The runtime of what, gcc or fixincludes? Whatever solution we come up
with, I'd like to avoid duplicating setting STDC_0_IN_SYSTEM_HEADERS,
i.e. bad idea to do it once in gcc and once in fixincludes. Better is
if we can include the target config file somehow.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu