On Thu, 2016-02-04 at 07:13 +0200, Tanu Kaskinen wrote: > On Thu, 2016-02-04 at 10:30 +0530, Arun Raghavan wrote: > > On 4 February 2016 at 10:22, Arun Raghavan <arun at accosted.net> > > wrote: > > > On Thu, 2016-02-04 at 06:04 +0200, Tanu Kaskinen wrote: > > > > On Mon, 2016-01-18 at 13:06 +0530, arun at accosted.net wrote: > > > > > @@ -176,6 +175,8 @@ esac > > > > > > > > > >  #### Compiler flags #### > > > > > > > > > > +AX_CHECK_COMPILE_FLAG([-std=c11], [CFLAGS="$CFLAGS > > > > > -std=c11"], [], > > > > > [-pedantic -Werror]) > > > > > > > > This does nothing if the compile flag isn't supported. > > > > Shouldn't we > > > > fail in configure if -std=c11 doesn't work? > > > > > > Right, I'm rewriting this line as: > > > > > > AX_CHECK_COMPILE_FLAG([-std=c11], > > >    [CFLAGS="$CFLAGS -std=c11"], > > >    [AC_MSG_ERROR([*** Compiler does not support -std=c11])], > > >    [-pedantic -Werror]) > > > > > > > Also, I don't think we should set CFLAGS. Adding -std=c11 to > > > > AM_CFLAGS > > > > in src/Makefile.am seems like the right thing to do. See > > > > https://www.gnu.org/software/automake/manual/html_node/User-Var > > > > iables > > > > .html#User-Variables > > > > > > This would make it inconsistent with the rest of configure.ac, > > > though. > > > It'd be nice to change everything to use AM_CFLAGS but that > > > should be a > > > separate change. > > I don't buy this argument. There's no consistency in the first place. > We set some flags via CFLAGS and some via AM_CFLAGS. Looking at this again, I don't see any place in the configure checks where AM_CFLAGS is set (and it looks to me like that this would not be appropriate anyway -- AM_CFLAGS seems meant to be used withing Makefile.am, not configure.ac). > > > One more thing that's missing in this change is an addition > > > of ax_check_compile_flag.m4. I'll squash that in too. > > > > The AX_* macros also seem to work with CFLAGS, btw. > > What do you mean by that? If you look at what AX_APPEND_COMPILE_FLAGS does, for example, it sets CFLAGS directly. -- Arun