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

Re: [Freeipa-devel] [PATCH 0026] Enable building in C99 mode



On Tue, 2013-12-17 at 15:03 +0100, Jan Cholasta wrote:
> On 17.12.2013 14:38, Nathaniel McCallum wrote:
> > On Tue, 2013-12-17 at 08:19 +0100, Jan Cholasta wrote:
> >> Hi,
> >>
> >> On 16.12.2013 22:12, Nathaniel McCallum wrote:
> >>> Patch attached.
> >>
> >> Care to elaborate? There's no ticket or explanation why this is
> >> beneficial or necessary.
> >
> > It enables compiling with C99 features, which I personally find very
> > beneficial. I am using these features (incomplete initializers and
> > for-loop declarations) in my DS plugin code. It is 2014 after all, and
> > most recent compilers support C11 at this point (certainly all the ones
> > we care to support)...
> >
> > Nathaniel
> >
> 
> Can you put something like this explanation in the commit message please?

Attached. However, I had to disable -Werror. This breaks the standard
C99 autoconf test (AC_PROG_CC_C99).

We probably shouldn't be distributing releases with -Werror. But at the
least, we definitely shouldn't be running autoconf with it. The typical
way to do this in autotools land is to add it in the Makefile only after
autoconf runs and only if you are not building the release (make dist).

Suggestions?

Nathaniel
>From 093b84b3c1698987e3a321abc1575b1f7b3f1554 Mon Sep 17 00:00:00 2001
From: Nathaniel McCallum <npmccallum redhat com>
Date: Mon, 16 Dec 2013 16:10:05 -0500
Subject: [PATCH] Enable building in C99 mode

C99 is supported on all compilers we target and
provides some useful features, including:
  * Standard struct initializers
  * Compound literals
  * For-loop declarations
  * Standard bool type
  * Variable arrays (use with caution)
  * Too many others to mention...
---
 Makefile                | 2 +-
 daemons/configure.ac    | 2 +-
 ipa-client/configure.ac | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index e54f8f0ba6484a12343f389b3cffbc20d7420a5f..7cdba10c6acae1f1fa5718433adcd698d27d58ed 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ endif
 
 PYTHON ?= $(shell rpm -E %__python || echo /usr/bin/python)
 
-CFLAGS := -g -O2 -Werror -Wall -Wextra -Wformat-security -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers $(CFLAGS)
+CFLAGS := -g -O2 -Wall -Wextra -Wformat-security -Wno-unused-parameter -Wno-sign-compare -Wno-missing-field-initializers $(CFLAGS)
 export CFLAGS
 
 # Uncomment to increase Java stack size for Web UI build in case it fails
diff --git a/daemons/configure.ac b/daemons/configure.ac
index e57dad27614f268d3e5bbafc99b739a5cfa2589b..7086d8e1054ad9941232c75fc0a82e050a682247 100644
--- a/daemons/configure.ac
+++ b/daemons/configure.ac
@@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
 
 AM_MAINTAINER_MODE
-AC_PROG_CC
+AC_PROG_CC_C99
 AC_STDC_HEADERS
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
diff --git a/ipa-client/configure.ac b/ipa-client/configure.ac
index 82b09615c436dcafcdd99547a2c500b4c4297d7e..34625622d3e3bb64866b3b0b1a58d29e33f11a7d 100644
--- a/ipa-client/configure.ac
+++ b/ipa-client/configure.ac
@@ -13,7 +13,7 @@ AM_INIT_AUTOMAKE([foreign])
 
 AM_MAINTAINER_MODE
 
-AC_PROG_CC
+AC_PROG_CC_C99
 AC_STDC_HEADERS
 AC_DISABLE_STATIC
 
-- 
1.8.4.2


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