[Top][All Lists]

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

uses old-style function definition, thus fails with -Werror=old-style-de

From: Vincent Lefevre
Subject: uses old-style function definition, thus fails with -Werror=old-style-definition
Date: Fri, 3 Jan 2014 22:51:45 +0100
User-agent: Mutt/1.5.21-6305-vl-r59709 (2013-04-16)

A developer may want to test his software with
-Werror=old-style-definition (in particular because such definitions
could be a real bug in the software). But configure fails because
autoconf (version 2.69) generates such a function definition.
For instance:

configure:4069: checking whether the C compiler works
configure:4130: gcc -O2 -Wall -Wold-style-declaration -Wold-style-definition 
-Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations 
-Wmissing-field-initializers -Werror   conftest.c  >&5
conftest.c: In function 'main':
conftest.c:12:1: error: old-style function definition 
 main ()
cc1: all warnings being treated as errors
configure:4130: $? = 1
configure:4144: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_TARNAME "mpfr"
| #define PACKAGE_VERSION "3.2.0-dev"
| #define PACKAGE_STRING "MPFR 3.2.0-dev"
| #define PACKAGE_URL ""
| #define MPFR_USE_LOGGING 1
| /* end confdefs.h.  */
| int
| main ()
| {
|   ;
|   return 0;
| }
configure:4144: error: in `/home/vlefevre/software/mpfr':
configure:4144: error: C compiler cannot create executables
See `config.log' for more details

Are there still compilers that fail on "int main(void) { ... }"?

In any case, certainly not when the compiler has been recognized
as gcc (like here).

Also reported as Debian bug 734104:


BTW, this old-style definition also makes configure fail with
CompCert (http://compcert.inria.fr/).

Vincent Lefèvre <address@hidden> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

reply via email to

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