From bbbdb69313bfe7611ae4430cd4c7c7e6657d0b43 Mon Sep 17 00:00:00 2001 From: Lukas Slebodnik Date: Fri, 11 Mar 2016 09:43:39 +0100 Subject: [PATCH 5/5] libipa_hbac: Ensure we always build with C90 libipa_hbac is also used by external projects such as pam_hbac: https://github.com/jhrozek/pam_hbac In order to make sure we don't use C99 features in the libipa_hbac code in the future, this patch adds an explicit -std=c89 flag to CFLAGS. --- Makefile.am | 5 +++++ src/util/sss_tc_utf8.c | 1 + src/util/sss_utf8.c | 3 +++ src/util/sss_utf8.h | 7 +++++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 481c6ad6f6b6257bdb5a845ffbb3b63920575fc7..7a299e5747015a6cef5664526b97eb606ed52a78 100644 --- a/Makefile.am +++ b/Makefile.am @@ -944,9 +944,14 @@ libipa_hbac_la_DEPENDENCIES = src/lib/ipa_hbac/ipa_hbac.exports libipa_hbac_la_SOURCES = \ src/lib/ipa_hbac/hbac_evaluator.c \ src/util/sss_utf8.c +# libipa_hbac is also used by external projects such as pam_hbac which +# support platforms that do not have a C99 compiler. We add -std=c89 +# explicitly here to make sure we don't accidentally add a C99 feature +# to the libipa_hbac code libipa_hbac_la_CFLAGS = \ $(AM_CFLAGS) \ -I$(top_srcdir)/src/util \ + -std=c89 \ $(NULL) libipa_hbac_la_LIBADD = \ $(UNICODE_LIBS) diff --git a/src/util/sss_tc_utf8.c b/src/util/sss_tc_utf8.c index 4b2c49316b43b79b37944cb517cf5bd4c32dddae..44194ab02f56bd7593055b2f1dad55e154fb1a1d 100644 --- a/src/util/sss_tc_utf8.c +++ b/src/util/sss_tc_utf8.c @@ -19,6 +19,7 @@ */ #include +#include "util/util.h" #include "util/sss_utf8.h" char * diff --git a/src/util/sss_utf8.c b/src/util/sss_utf8.c index 7ba11ca759f3dddda6585dddb8add9a8395bba4b..722f28d08a7f884ef1e7947887becd672eb490af 100644 --- a/src/util/sss_utf8.c +++ b/src/util/sss_utf8.c @@ -22,6 +22,9 @@ #include "config.h" +#include +#include + #ifdef HAVE_LIBUNISTRING #include #include diff --git a/src/util/sss_utf8.h b/src/util/sss_utf8.h index 95b085f56a9b17c711029246d1fd0dedcade867b..bca9b2c5193cb8a11339017639a5ec658f5068a5 100644 --- a/src/util/sss_utf8.h +++ b/src/util/sss_utf8.h @@ -23,12 +23,15 @@ #ifndef SSS_UTF8_H_ #define SSS_UTF8_H_ -#include "util/util.h" - #ifndef ENOMATCH #define ENOMATCH -1 #endif +#include +#include + +#include "util/util_errors.h" + void sss_utf8_free(void *ptr); /* The result must be freed with sss_utf8_free() */ -- 2.4.3