Branch: Tag:

2014-12-02

2014-12-02 19:43:59 by Arne Goedeke <el@laramies.com>

Configure: fixed test for __attribute__ support

va_start and other macros expect the va_list as first argument.
This test only produced warnings with most compilers, which is
why this problem was never fixed.

6449:    [    AC_TRY_RUN([   #include <stdarg.h> + #include <stdio.h> + #include <stdlib.h>   void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2)));   int sqr(int x) __attribute__ ((const));   
6457:   void fatal(char *foo,...)   {    va_list args; -  va_start(foo,args); +  va_start(args, foo);    printf(foo,args);    va_end(args);    exit(2);
6469:    echo $ac_n "crosscompiling... $ac_c" 1>&6    AC_TRY_LINK([   #include <stdarg.h> + #include <stdio.h> + #include <stdlib.h>   void fatal(char *foo,...) __attribute__ ((noreturn,format (printf,1,2)));   int sqr(int x) __attribute__ ((const));   
6477:   void fatal(char *foo,...)   {    va_list args; -  va_start(foo,args); +  va_start(args, foo);    printf(foo,args);    va_end(args);    exit(2);