This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: va_arg *, and why not.


On Mon, Jul 17, 2000 at 04:53:06PM +0200, Franz Sirl wrote:
> dnl Does this platform require array notation to assign to a va_list?
> dnl If cross-compiling, we assume va_list is "normal".  If this breaks
> dnl you, set ac_cv_valistisarray=true and maybe define HAVE_VA_LIST_AS_ARRAY
> dnl also just to be sure.
> AC_MSG_CHECKING(whether va_list assignments need array notation)
> AC_CACHE_VAL(ac_cv_valistisarray,
>          [AC_TRY_RUN([#include <stdlib.h>
>                       #include <stdarg.h>
>                       void foo(int i, ...) {
>                          va_list ap1, ap2;
>                          va_start(ap1, i);
>                          ap2 = ap1;

Seems a bit silly to use a run test instead of a compile test.
If va_list is an array, we'll get a compile error right here.
Fixing that would solve the silliness with the cross-compile default.


r~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]