From: Aurelien Jacobs Date: Sun, 26 Apr 2015 22:06:03 +0000 (+0200) Subject: Compile with -std=c11 along with _POSIX_C_SOURCE=200112L. X-Git-Tag: libsigrok-0.4.0~517 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=e35e1e7babee3cb3939e56f06322fa14f8580625;hp=76372c5a9ce25d94ee992a5c84b8135f0d945293 Compile with -std=c11 along with _POSIX_C_SOURCE=200112L. With gcc 5.1 released and defaulting to std=gnu11, the code will be compiled according to different standards depending on the compiler version so we should better specify explicitly what standard we are targetting. C11 is now quite mature, it is supported in the just release Debian stable (gcc 4.9) and also in old-stable (gcc 4.7), so there should be no reason to use anything more ancient. We also should have no reason to need any non-standard GNU extension. So using only C11 + POSIX sounds like the best option right now. --- diff --git a/configure.ac b/configure.ac index bc9ce712..85087b5d 100644 --- a/configure.ac +++ b/configure.ac @@ -45,7 +45,7 @@ AH_BOTTOM([#endif /* SR_CONFIG_H */]) # Enable more compiler warnings via -Wall and -Wextra. Add -fvisibility=hidden # and enforce use of SR_API to explicitly mark all public API functions. COMMON_FLAGS="$CFLAGS -Wall -Wextra -fvisibility=hidden" -CFLAGS="$COMMON_FLAGS -Wmissing-prototypes" +CFLAGS="$COMMON_FLAGS -std=c11 -D_POSIX_C_SOURCE=200112L -Wmissing-prototypes" CXXFLAGS="-std=c++11 $COMMON_FLAGS" # Checks for programs.