bug-autoconf
[Top][All Lists]
Advanced

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

AC_FUNC_ALLOCA generates warning (problem with -Werror)


From: Jaap Haitsma
Subject: AC_FUNC_ALLOCA generates warning (problem with -Werror)
Date: Mon, 05 Jun 2006 23:27:16 +0200

Hi

AC_FUNC_ALLOCA generates the following code

#include <alloca.h>
int
main ()
{
char *p = (char *) alloca (2 * sizeof (int));
  ;
  return 0;
}

This generates a warning that the variable p is never used. This is a
problem when you run configure with CFLAG="-Werror". Compilation of the
above code will fail.

This can be easily solved by adding the following line

for (;&p!=0;) {/*Use p so we do not generate a warning */}

Jaap






reply via email to

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