Open PHHargrove opened 9 years ago
The conditions to reproduce this issue are identical to those for BUPC bug #3210.
In that case the solution was use of some preprocessor logic in the stdarg.h wrapper (in upcr_geninclude) used in only the first preprocess. It seems likely that such an approach would work here too (since the passes are identical). However, I'd like to avoid adding such a wrapper if this turns out to be something that can/should/will be fixed upstream.
The test code and series of compilation commands below show that on Solaris-11 for x86-64, including stdio.h before stddef.h results in incorrect va_list related definitions IFF on passes -UGNUC to clang. This is true only for the default ILP32 ABI, but not for LP64. The shell command (and output) below show all 8 combinations of (-m64 vs -m32) x (w/ vs w/o -UGNUC) x (w/ stdio.h included before vs after stddef.h).
Note that only one case out of the 8 fail, and when it does the complaint is about clang's private stddef.h header.