Olaf Weber <[EMAIL PROTECTED]> writes: > why wouldn't something like this work? > > int array[!!(x)*2-1];
[EMAIL PROTECTED] (Paul Jarc) writes: > Does anyone know how "char test[(whatever)? 1: -1];" fares? Autoconf used to do something like that, and it works in practice if 'x' and 'whatever' are integer constant expressions. Unfortunately it doesn't work they contains floating-point arithmetic, because the C Standard doesn't allow arbitrary arithmetic constant expressions when declaring array bounds: they must be integer constant expressions, and therefore most uses of floating point is invalid. This caused AC_C_LONG_DOUBLE to fail when using the Sun native compilers (which insist on conformance to the C Standard here; see <http://lists.gnu.org/archive/html/bug-autoconf/2004-06/msg00003.html>). Another possible fix is to add a separate macro for arithmetic constant expressions that are not integer constant expressions, but I'd rather keep things simpler for the user and have just one macro that works for all arithmetic constant expressions. _______________________________________________ Autoconf mailing list [EMAIL PROTECTED] http://lists.gnu.org/mailman/listinfo/autoconf
