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: RFA: how to handle union wait portably?


Kaveh R. Ghazi <ghazi@caip.rutgers.edu> wrote:

> Hmm, you say you have conflicts with sys/wait.h.  But IIRC the test
> for sys/wait.h not only checks whether the file exists, but also
> whether it is POSIX compatible.  BSD's is not, so you shouldn't see it
> get included during bootstrap.  I think that is the cause of your
> problems, what does cofigure say for this test?
>
> "checking for sys/wait.h that is POSIX.1 compatible... ???"
>
> If it says "yes", does forcing it to "no" fix your problem,
> and can you figure out why it erroneously says "yes"?

Kaven, you've hit the nail right on the head! "sys/wait.h that is POSIX.1
compatible" means that you can apply WIFEXITED and WIFSIGNALED to an int,
right? If so, the autoconf test is correct, but... it is negative when the
compiler is GCC but positive when the compiler is PCC! 4.3BSD's <sys/wait.h>
defines WIFEXITED and WIFSIGNALED macros that apply the dot operator to their
argument. This causes <sys/wait.h> to be not POSIX-compliant assuming an ISO C
compiler that doesn't allow applying the dot operator to an int. However, PCC
does allow applying the dot operator to an int, so when the compiler is PCC,
4.3BSD's <sys/wait.h> technically *is* POSIX-compliant!

The upshot of all this is that everything works correctly except when doing a
3-stage GCC bootstrap with make bootstrap using the native cc as the starting
compiler. I don't see how the GCC source could be changed to avoid this
problem.

The easiest solution for me personally would be to simply not use make
bootstrap (which I never liked anyway). I will still test my patches for
bootstrapability as required, but I'll do it by installing the intermediate
stages and doing a new fresh configure and make for the next stage.

--
Michael Sokolov
Public Service Agent
International Engineering and Science Task Force

1351 VINE AVE APT 27		Phone: +1-714-738-5409
FULLERTON CA 92833-4291 USA	(home office)

E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP)

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