[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ANSI C89 and gnulib
From: |
Reuben Thomas |
Subject: |
ANSI C89 and gnulib |
Date: |
Mon, 21 Sep 2009 23:55:19 +0100 |
Hi,
I'm sorry, I have a memory of asking about this before, but I can't
after much searching find the previous correspondence, if any.
When building with -ansi -pedantic, I get warnings like this:
In file included from printf-args.c:30:
printf-args.h:105: warning: ISO C90 does not support 'long long'
but shouldn't gnulib work with C89? I am turning on C89 mode early,
i.e. before gl_EARLY. (Part of my problem last time was only adding
-ansi -pedantic after gl_EARLY, which understandably did not work.)
The early part of my configure.ac goes (after AC_INIT and
AM_INIT_AUTOMAKE):
dnl Set up C compiler
AC_GNU_SOURCE
AC_PROG_CC
AX_CFLAGS_WARN_ALL
if test "$GCC" = "yes"; then
 CFLAGS="$CFLAGS -W -Wmissing-prototypes -Wstrict-prototypes
-D_FORTIFY_SOURCE=2"
fi
AX_CFLAGS_FORCE_C89
gl_EARLY
AM_PROG_CC_C_O
AX_CFLAGS_FORCE_C89 is a new macro in autoconf-archive that I based on
AX_CFLAGS_WARN_ALL, and it just adds -ansi -pedantic (or equivalent
flags in other compilers), unlike AC_PROG_CC_C89, which only ensures
at least ANSI compatibility rather than strict compatibility.
--
http://rrt.sc3d.org
Psalms 19:12: tagline for the guilty
- ANSI C89 and gnulib,
Reuben Thomas <=