[PATCH 4/6] compilation: Set C language standard to gnu11

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2016-03-14 at 00:00 +0200, Ahmed S. Darwish wrote:
> Per glibc feature_test_macros(7), setting compiler flags to
> -std=c11 (or any c* variant like c99) enforces strict ANSI
> mode.
> 
> Enforcing strict ANSI makes all declarations under _GNU_SOURCE
> unavailable. This leads to build warnings in the form of:
> 
>     warning: implicit declaration of function â??syscallâ??
> 
> Thus replace -std=c11 with -std=gnu11
> 
> Signed-off-by: Ahmed S. Darwish <darwish.07 at gmail.com>
> ---
>  configure.ac    | 4 ++--
>  src/Makefile.am | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 8454e4c..fc1e299 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -176,9 +176,9 @@ esac
>  
>  #### Compiler flags ####
>  
> -AX_CHECK_COMPILE_FLAG([-std=c11],
> +AX_CHECK_COMPILE_FLAG([-std=gnu11],
>     [],
> -   [AC_MSG_ERROR([*** Compiler does not support -std=c11])],
> +   [AC_MSG_ERROR([*** Compiler does not support -std=gnu11])],
>     [-pedantic -Werror])
>  
>  AX_APPEND_COMPILE_FLAGS(
> diff --git a/src/Makefile.am b/src/Makefile.am
> index aa96999..b979d46 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -48,7 +48,7 @@ AM_CPPFLAGS = \
>  	-DPA_SRCDIR=\"$(abs_srcdir)\" \
>  	-DPA_BUILDDIR=\"$(abs_builddir)\" \
>  	-DPULSE_LOCALEDIR=\"$(localedir)\"
> -AM_CFLAGS = -std=c11 \
> +AM_CFLAGS = -std=gnu11 \
>  	$(PTHREAD_CFLAGS)
>  AM_CXXFLAGS = -std=c++11 \
>  	$(PTHREAD_CFLAGS)

Thanks! Applied.

-- 
Tanu


[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux