[LLVMbugs] Compile error on 64-bit x86 Solaris

Chris Lattner sabre at nondot.org
Wed Oct 24 10:21:54 PDT 2007


On Wed, 24 Oct 2007, Dale Johannesen wrote:
>> Now, the problem is that the system header <sys/regset.h> gets
>> included which contains the following #defines:
>>
>> #define CS              15
>> #define DS              3
>>
>> (among others).  The LLVM code uses very much both of those names
>> which results in a buch of compiler errors similar to the above.
>
> Those names are in the user namespace; it is incorrect for <signal.h>
> to be defining them.  Any chance of getting your headers fixed?

Two things:
1. Only .cpp files in lib/System should include <signal.h>.  If there are
    others, we should eliminate them and move the system-specific
    functionality there.
2. Assuming that you can't change solaris :), it would be fine to do this:

#include <signal.h>
#undef CS  // hack for broken solaris headers
#undef DS  // hack for broken solaris headers

This is clearly ugly if spread through the source tree, which is why #1 is 
important :)

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-bugs mailing list