]> granicus.if.org Git - json-c/commitdiff
Use a macro to indicate C99 to the compiler
authorSevan Janiyan <venture37@geeklan.co.uk>
Tue, 5 Jan 2016 11:43:17 +0000 (11:43 +0000)
committerSevan Janiyan <venture37@geeklan.co.uk>
Tue, 5 Jan 2016 11:43:17 +0000 (11:43 +0000)
The [AC_PROG_CC_C99 macro](https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/C-Compiler.html) sets the complier to the C99 standard if the compiler does not default to such behaviour (albeit gnu99). This is better than specifically hardcoding flags

configure.ac

index 2f3c92ff33cfd74ddcdb17bb91ec18766ecc708e..7d43cadafbce652334462502014d693f9fbeaabb 100644 (file)
@@ -30,6 +30,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
 # Checks for header files.
 AM_PROG_CC_C_O
+AC_PROG_CC_C99
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_HEADER(json_config.h)
 AC_HEADER_STDC
@@ -104,7 +105,6 @@ AC_SUBST(JSON_BSYMBOLIC_LDFLAGS)
 
 AX_APPEND_COMPILE_FLAGS([-Wall -Werror -Wno-error=deprecated-declarations])
 AX_APPEND_COMPILE_FLAGS([-Wextra -Wwrite-string -Wno-unused-parameter])
-AX_APPEND_COMPILE_FLAGS([-std=gnu99])
 AX_APPEND_COMPILE_FLAGS([-D_GNU_SOURCE -D_REENTRANT])
 
 AC_CONFIG_FILES([