[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AC_LANG_BOOL_COMPILE_TRY(C) fails with OS vendor compilers

From: Paul Eggert
Subject: Re: AC_LANG_BOOL_COMPILE_TRY(C) fails with OS vendor compilers
Date: Fri, 02 Jul 2004 09:07:02 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Olaf Weber <address@hidden> writes:

> why wouldn't something like this work?
>         int array[!!(x)*2-1];

address@hidden (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

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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]