autoconf
[Top][All Lists]
Advanced

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

AC_PROG_CC_C99 should prefer "c99" as name of compiler


From: Gavin Smith
Subject: AC_PROG_CC_C99 should prefer "c99" as name of compiler
Date: Tue, 12 Jan 2016 15:38:03 +0000

I think it might be a good idea if AC_PROG_CC_C99 used "c99" in
preference to other command names ("cc") for the name of the C
compiler.

POSIX requires this command to be available:

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/c99.html#tag_20_11

Why do I make this suggestion? It's due to a problem I had compiling a
program under OpenIndiana 11. The configure script found "cc" as the
compiler, and it passed the checks for C99 features. However, the
source code had

#define _XOPEN_SOURCE 600

before including system headers, and this led to an error message:

#error: "Compiler or options invalid; UNIX 03 and POSIX.1-2001
    applications       require the use of c99"

The system headers refuse to allow the program to compile, even though
it would in all likelihood be fine.

I wondered who was to blame for being nonconformant to standards:
OpenIndiana, or the autoconf script? OpenIndiana did have a C99
compiler and POSIX headers, but the right compiler just wasn't used. I
can't see any argument to say that OpenIndiana is the problem here. If
autoconf had tried for the C compiler under the standardized name
first, there wouldn't have been a problem.



reply via email to

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