]> diplodocus.org Git - nmh/commitdiff
Default CFLAGS to -std=c99 instead of -ansi.
authorDavid Levine <levinedl@acm.org>
Thu, 17 Aug 2017 23:45:20 +0000 (19:45 -0400)
committerDavid Levine <levinedl@acm.org>
Thu, 17 Aug 2017 23:45:20 +0000 (19:45 -0400)
gcc -ansi -pedantic issued a few warnings about C90 not supporting the
"ll" printf length modifier.  Ralph pointed out that
http://www.unix.org/version4/overview.html says:

    The following source code portability standards lie at the core of
    the Single UNIX Specification:

        POSIX.1-2008

    (This is technically identical to the Base Specifications, Issue 7;
    they are one and the same document.)

        The ISO/IEC 9899:1999 standard

So perhaps we're wrong to expect modern POSIX code to compile as C90.

build_nmh

index 8056670..832bd58 100755 (executable)
--- a/build_nmh
+++ b/build_nmh
@@ -364,7 +364,7 @@ if [ -z "$CFLAGS" ]; then
   if cc -dM -E - </dev/null 2>&1 | grep __GNUC__ >/dev/null; then
     #### configure will supply -g -O2 with gcc, but only if CFLAGS
     #### isn't defined.
-    CFLAGS='-g -ansi -pedantic'
+    CFLAGS='-g -std=c99 -pedantic'
     if [ "$config_debug" = n ]; then
       CFLAGS="$CFLAGS -O2"
     else