bug-coreutils
[Top][All Lists]
Advanced

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

Re: make fails


From: Pádraig Brady
Subject: Re: make fails
Date: Wed, 10 Jun 2009 10:33:50 +0100
User-agent: Thunderbird 2.0.0.6 (X11/20071008)

Eric Blake wrote:
> According to peter on 6/9/2009 10:47 AM:
>>    I run configure.  It runs fine.  I compile it, and every instance of
>> a variable not declared at the beginning of a block produces a compiler
>> error.  I assume this is some recent modification to the C standard that
>> is certainly reasonable, that the compiler on this machine doesn't have.
> 
> Yes - this is a new requirement of C99 (a standard that is now 10 years
> old, although admittedly slow in the complete uptake by most vendors), but
> not present in C89 (20 years old).  If your compiler can't handle
> declarations after statements, it is indeed quite old, and you may want to
> consider upgrading your compiler first.

What compiler are you using as a matter of interest?

> 
>>    But what I'm wondering is why doesn't the configure script catch it?
> 
> This has been brought up in the past.  The consensus was that it is a
> mechanical patch, but one that we don't want to maintain unless there is a
> high demand for it (so far, there hasn't been).
> http://lists.gnu.org/archive/html/bug-coreutils/2006-11/msg00197.html

Right. Requiring C99 would preclude the patch approach.
Note if we were to require it, something like the following might
be too restrictive, since it requires support in autoconf-2.61 for:

"_Bool, // comments, flexible array members, inline,
signed and unsigned long long int, mixed code and declarations,
named initialization of structs, restrict, va_copy, varargs macros,
variable declarations in for loops, and variable length arrays."

In future we might add a test for a subset of those C99 features.

diff --git a/configure.ac b/configure.ac
index 32d2958..cab234b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,10 @@ AC_CONFIG_HEADERS([lib/config.h:lib/config.hin])
 AM_INIT_AUTOMAKE([1.11 dist-xz color-tests parallel-tests])
 AM_SILENT_RULES([yes]) # make --enable-silent-rules the default.

-AC_PROG_CC_STDC
+AC_PROG_CC_C99
+if test "$ac_cv_prog_cc_c99" = no; then
+  AC_MSG_ERROR([Your C compiler cannot compile ISO Standard C (currently C99)])
+fi
 AM_PROG_CC_C_O
 AC_PROG_CPP
 AC_PROG_GCC_TRADITIONAL

cheers,
Pádraig.




reply via email to

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