Hello,

the attached patch switches libgfortran C sources to be compiled in
gnu11 mode instead of gnu99. As the 4.9 release notes
http://gcc.gnu.org/gcc-4.9/changes.html say,

"ISO C11 support is now at a similar level of completeness to ISO C99
support: substantially complete modulo bugs, extended identifiers
(supported except for corner cases when -fextended-identifiers is
used), floating-point issues (mainly but not entirely relating to
optional C99 features from Annexes F and G) and the optional Annexes K
(Bounds-checking interfaces) and L (Analyzability)."

An overview of new features in C11 can be seen e.g. at

https://en.wikipedia.org/wiki/C11_%28C_standard_revision%29

And the current status of C11 support in GCC is at

http://gcc.gnu.org/wiki/C11Status

Similar to the case of C99 support, we cannot rely on the new library
features being present, but the language features can be used, e.g.
_Noreturn, _Static_assert, anonymous structs and unions could
potentially be useful for libgfortran.

Since libgfortran is compiled by the stage 3 compiler, there shouldn't
be any bootstrapping issues wrt. older (stage 1) compilers.

Ok for trunk?

2014-05-01  Janne Blomqvist  <j...@gcc.gnu.org>

    * configure.ac (AM_CFLAGS): Use -std=gnu11.
    (CFLAGS): Likewise.
    * configure: Regenerated.


-- 
Janne Blomqvist
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 24dbf2b..2126285 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -139,12 +139,13 @@ AM_PROG_CC_C_O
 # Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
 if test "x$GCC" = "xyes"; then
   AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays 
-fno-underscoring"
-  ## We like to use C99 routines when available.  This makes sure that
+  ## We like to use C11 and C99 routines when available.  This makes
+  ## sure that
   ## __STDC_VERSION__ is set such that libc includes make them available.
-  AM_CFLAGS="-std=gnu99 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings"
+  AM_CFLAGS="-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes 
-Wold-style-definition -Wextra -Wwrite-strings"
   ## Compile the following tests with the same system header contents
   ## that we'll encounter when compiling our own source files.
-  CFLAGS="-std=gnu99 $CFLAGS"
+  CFLAGS="-std=gnu11 $CFLAGS"
 fi
 AC_SUBST(AM_FCFLAGS)
 AC_SUBST(AM_CFLAGS)

Reply via email to