Noah Misch <[EMAIL PROTECTED]> writes:
> How about this?
>
> 2.1. Test { int c[(x) ? 1 : -1]; }
> 2.2. Test { int c[!(x) ? 1 : -1]; }
> 2.3. If exactly one of 2.1 and 2.2 fails, use result of 2.1. Else:
> 2.4. Test { int c = 1/!!(x); }
> 2.5. Test { int c = 1/!(x); }
> 2.6. If exactly one of 2.4 and 2.5 fails, use result of 2.4. Otherwise,
> AC_MSG_ERROR with suggested switched to place in CFLAGS.
>
> This should cover all the cases we have observed, prevent a (minute) regression
> in the next release, and report the cases it does not handle.
Yes, that sounds like a good strategy for cross-compiles. For native
compiles, we could bypass all this and simply run a program.
> Another option, should this issue arise again, is to abuse the bit field size
> expression:
>
> struct foo { int bar : (x ? 8 : -8); };
>
> This will probably have the exact same success and failure modes as the array
> size trick, but I'd be interested to see if Sun CC is kinder to it.
It behaves the same as the array size trick, which shouldn't be too
surprising.
_______________________________________________
Autoconf mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/autoconf