Nick Burrett wrote:
Frank Heckenbach frank@g-n-u.de writes:
Honda Hirotaka wrote:
I'm trying to build gpc-20001019 on an old i486DX2 DECpc running FreBSD 2.2.8 , but I get the error message of "gcc-2.95.2/gcc/p/rts/rts.c:326: `T_RESADFLT' undeclared here (not in a function)" .
I can't find the word "T_RESADFLT" in rts.c. I want to know what is happenning.
No, this word doesn't occur. However, the line refers to ILL_RESAD_FAULT (and two lines below to ILL_RESOP_FAULT).
So, it may be that these symbols are defined to T_RESADFLT and T_RESOPFLT in some system header, but the latter symbols are not defined. Now, why would one define something to something undefined? I don't know, I guess only a C programmer can understand this...
FreeBSD doesn't use T_RESADFLT or T_RESOPFLT and therefore doesn't define them.
The ILL_* macros are defined as placeholders for a time when they might be used.
So, they define them so #ifdef ILL_... is true, but ILL_... still can't be used. Very strange, IMHO...
So for FreeBSD, you will need to check that the definitions of T_RESADFLT and T_RESOPFLT exist and then fix the definition of ILL_RESAD_FAULT and ILL_RESOP_FAULT accordingly.
I'd consider this a last resort. I mean we want to use ILL_... -- why should we check whether T_... is defined? Perhaps the next system defined them to BLAH_... and whatever, what then?
The ILL_RESAD_FAULT and ILL_RESOP_FAULT are defined by FreeBSD in machine/trap.h if you are curious.
We don't include this. We include signal.h if it exists, and if not, bsd/signal.h if that exists. Probably machine/trap.h is included by one of them (or some other header we use).
This is also where the corresponding T_* macros are defined.
Now I don't understand. You said above they're not defined, didn't you? So, should we explicitly include machine/trap.h, would that help?
More generally: Is there any point in supporting these things (subcodes of numeric error signals) at all? AFAICS, they're remainings from the signal handler in ancient versions of the RTS (which had been disabled for a long time). This handler was labeled "BSD style", but if these things are not even supported on FreeBSD, perhaps we should simply drop them. Does any other system support them?
Frank