Skip to contentSkip to conversation

quiet gcc warnings

PATCH Applied [email protected] 3 participants 12 messages Jan 3, 2008 – Jan 9, 2008 SELinux security module

lore
Share & tools
lore
#0 lore raw

cover quiet gcc warnings

These patches fix a number of gcc warnings in the selinux userland build process. They allow everything but libsemanage to build with -Werror. The only thing in the way of libsemanage using -Werror is the flex-generated scanner. We could just drop a few of the -W flags for libsemanage (like -Wundef) to make it pass.

Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw

PATCH 1/7 quiet checkpolicy warnings

Fix shadowed variable in dispol/dismod
Use bison instead of yacc to avoid an unused label warning.

---
 checkpolicy/Makefile      |    2 ++
 checkpolicy/test/dismod.c |    8 ++++----
 checkpolicy/test/dispol.c |    8 ++++----
 3 files changed, 10 insertions(+), 8 deletions(-)
checkpolicy/Makefile +2 -0
Index: trunk/checkpolicy/Makefile
===================================================================
@@ -8,6 +8,8 @@ LIBDIR ?= $(PREFIX)/lib
 INCLUDEDIR ?= $(PREFIX)/include
 TARGETS = checkpolicy checkmodule
 
+YACC = bison -y
+
 CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
checkpolicy/test/dismod.c +4 -4
Index: trunk/checkpolicy/test/dismod.c
===================================================================
@@ -666,13 +666,13 @@ int display_avblock(int field, uint32_t 
 	return 0;
 }
 
-int display_handle_unknown(policydb_t * policydb, FILE * out_fp)
+int display_handle_unknown(policydb_t * p, FILE * out_fp)
 {
-	if (policydb->handle_unknown == ALLOW_UNKNOWN)
+	if (p->handle_unknown == ALLOW_UNKNOWN)
 		fprintf(out_fp, "Allow unknown classes and perms\n");
-	else if (policydb->handle_unknown == DENY_UNKNOWN)
+	else if (p->handle_unknown == DENY_UNKNOWN)
 		fprintf(out_fp, "Deny unknown classes and perms\n");
-	else if (policydb->handle_unknown == REJECT_UNKNOWN)
+	else if (p->handle_unknown == REJECT_UNKNOWN)
 		fprintf(out_fp, "Reject unknown classes and perms\n");
 	return 0;
 }
checkpolicy/test/dispol.c +4 -4
Index: trunk/checkpolicy/test/dispol.c
===================================================================
@@ -274,13 +274,13 @@ int display_cond_expressions(policydb_t 
 	return 1;
 }
 
-int display_handle_unknown(policydb_t * policydb, FILE * out_fp)
+int display_handle_unknown(policydb_t * p, FILE * out_fp)
 {
-	if (policydb->handle_unknown == ALLOW_UNKNOWN)
+	if (p->handle_unknown == ALLOW_UNKNOWN)
 		fprintf(out_fp, "Allow unknown classes and permisions\n");
-	else if (policydb->handle_unknown == DENY_UNKNOWN)
+	else if (p->handle_unknown == DENY_UNKNOWN)
 		fprintf(out_fp, "Deny unknown classes and permisions\n");
-	else if (policydb->handle_unknown == REJECT_UNKNOWN)
+	else if (p->handle_unknown == REJECT_UNKNOWN)
 		fprintf(out_fp, "Reject unknown classes and permisions\n");
 	return 0;
 }
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#2 lore raw

PATCH 2/7 quiet libsepol qualifier warnings

In reply to [email protected]

Fix discarded const warnings in mls.c by sprinkling const in mls_level_eq, mls_level_dom and the ebitmap functions.

---
 libsepol/include/sepol/policydb/ebitmap.h   |   12 ++++++------
 libsepol/include/sepol/policydb/mls_types.h |    4 ++--
 libsepol/src/ebitmap.c                      |   12 ++++++------
 3 files changed, 14 insertions(+), 14 deletions(-)
libsepol/include/sepol/policydb/ebitmap.h +6 -6
Index: trunk/libsepol/include/sepol/policydb/ebitmap.h
===================================================================
@@ -73,12 +73,12 @@ static inline int ebitmap_node_get_bit(e
 #define ebitmap_for_each_bit(e, n, bit) \
 	for (bit = ebitmap_start(e, &n); bit < ebitmap_length(e); bit = ebitmap_next(&n, bit)) \
 
-extern int ebitmap_cmp(ebitmap_t * e1, ebitmap_t * e2);
-extern int ebitmap_or(ebitmap_t * dst, ebitmap_t * e1, ebitmap_t * e2);
-extern int ebitmap_union(ebitmap_t * dst, ebitmap_t * e1);
-extern int ebitmap_cpy(ebitmap_t * dst, ebitmap_t * src);
-extern int ebitmap_contains(ebitmap_t * e1, ebitmap_t * e2);
-extern int ebitmap_get_bit(ebitmap_t * e, unsigned int bit);
+extern int ebitmap_cmp(const ebitmap_t * e1, const ebitmap_t * e2);
+extern int ebitmap_or(ebitmap_t * dst, const ebitmap_t * e1, const ebitmap_t * e2);
+extern int ebitmap_union(ebitmap_t * dst, const ebitmap_t * e1);
+extern int ebitmap_cpy(ebitmap_t * dst, const ebitmap_t * src);
+extern int ebitmap_contains(const ebitmap_t * e1, const ebitmap_t * e2);
+extern int ebitmap_get_bit(const ebitmap_t * e, unsigned int bit);
 extern int ebitmap_set_bit(ebitmap_t * e, unsigned int bit, int value);
 extern void ebitmap_destroy(ebitmap_t * e);
 extern int ebitmap_read(ebitmap_t * e, void *fp);
libsepol/include/sepol/policydb/mls_types.h +2 -2
Index: trunk/libsepol/include/sepol/policydb/mls_types.h
===================================================================
@@ -70,12 +70,12 @@ static inline void mls_level_destroy(str
 	mls_level_init(level);
 }
 
-static inline int mls_level_eq(struct mls_level *l1, struct mls_level *l2)
+static inline int mls_level_eq(const struct mls_level *l1, const struct mls_level *l2)
 {
 	return ((l1->sens == l2->sens) && ebitmap_cmp(&l1->cat, &l2->cat));
 }
 
-static inline int mls_level_dom(struct mls_level *l1, struct mls_level *l2)
+static inline int mls_level_dom(const struct mls_level *l1, const struct mls_level *l2)
 {
 	return ((l1->sens >= l2->sens) && ebitmap_contains(&l1->cat, &l2->cat));
 }
libsepol/src/ebitmap.c +6 -6
Index: trunk/libsepol/src/ebitmap.c
===================================================================
@@ -15,7 +15,7 @@
 #include "debug.h"
 #include "private.h"
 
-int ebitmap_or(ebitmap_t * dst, ebitmap_t * e1, ebitmap_t * e2)
+int ebitmap_or(ebitmap_t * dst, const ebitmap_t * e1, const ebitmap_t * e2)
 {
 	ebitmap_node_t *n1, *n2, *new, *prev;
 
@@ -58,7 +58,7 @@ int ebitmap_or(ebitmap_t * dst, ebitmap_
 	return 0;
 }
 
-int ebitmap_union(ebitmap_t * dst, ebitmap_t * e1)
+int ebitmap_union(ebitmap_t * dst, const ebitmap_t * e1)
 {
 	ebitmap_t tmp;
 
@@ -71,7 +71,7 @@ int ebitmap_union(ebitmap_t * dst, ebitm
 	return 0;
 }
 
-int ebitmap_cmp(ebitmap_t * e1, ebitmap_t * e2)
+int ebitmap_cmp(const ebitmap_t * e1, const ebitmap_t * e2)
 {
 	ebitmap_node_t *n1, *n2;
 
@@ -92,7 +92,7 @@ int ebitmap_cmp(ebitmap_t * e1, ebitmap_
 	return 1;
 }
 
-int ebitmap_cpy(ebitmap_t * dst, ebitmap_t * src)
+int ebitmap_cpy(ebitmap_t * dst, const ebitmap_t * src)
 {
 	ebitmap_node_t *n, *new, *prev;
 
@@ -121,7 +121,7 @@ int ebitmap_cpy(ebitmap_t * dst, ebitmap
 	return 0;
 }
 
-int ebitmap_contains(ebitmap_t * e1, ebitmap_t * e2)
+int ebitmap_contains(const ebitmap_t * e1, const ebitmap_t * e2)
 {
 	ebitmap_node_t *n1, *n2;
 
@@ -148,7 +148,7 @@ int ebitmap_contains(ebitmap_t * e1, ebi
 	return 1;
 }
 
-int ebitmap_get_bit(ebitmap_t * e, unsigned int bit)
+int ebitmap_get_bit(const ebitmap_t * e, unsigned int bit)
 {
 	ebitmap_node_t *n;
 
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#3 lore raw

PATCH 3/7 quiet getdefaultcon warning

In reply to [email protected]

Fix uninitialized variable in error path if getseuserbyname() fails.

---
 libselinux/utils/getdefaultcon.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
libselinux/utils/getdefaultcon.c +1 -1
Index: trunk/libselinux/utils/getdefaultcon.c
===================================================================
@@ -57,7 +57,7 @@ int main(int argc, char **argv)
 	} else
 		cur_context = argv[optind + 1];
 
-	if (getseuserbyname(user, &seuser, &dlevel)==0) {
+	if ((ret = getseuserbyname(user, &seuser, &dlevel)) == 0) {
 		if (! level) level=dlevel;
 		if (role != NULL && role[0]) 
 			ret=get_default_context_with_rolelevel(seuser, role, level,cur_context,&usercon);
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#4 lore raw

PATCH 4/7 quiet libsemanage scanner warnings

In reply to [email protected]

Supress the generation of unused functions in the scanner. There are still a few warnings about the generated scanner code but that has to be fixed in flex.

---
 libsemanage/src/conf-scan.l |    1 +
 1 file changed, 1 insertion(+)
libsemanage/src/conf-scan.l +1 -0
Index: trunk/libsemanage/src/conf-scan.l
===================================================================
@@ -32,6 +32,7 @@ int yywrap(void);
 %}
 
 %option stack prefix="semanage_"
+%option nounput noyy_push_state noyy_pop_state noyy_top_state
 
 %x arg
 
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#5 lore raw

PATCH 5/7 quiet libsepol uninitialized variable warnings

In reply to [email protected]

Fix some gcc warnings about uninitialized variables. For genusers.c, BADLINE() was being used inside an inner loop that prevented it from working for those two cases.

---
 libsepol/src/genusers.c  |    7 +++++--
 libsepol/src/hierarchy.c |   11 ++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)
libsepol/src/genusers.c +5 -2
Index: trunk/libsepol/src/genusers.c
===================================================================
@@ -117,17 +117,18 @@ static int load_users(struct policydb *p
 		} else
 			islist = 0;
 
+		oldc = 0;
 		do {
 			while (*p && isspace(*p))
 				p++;
 			if (!(*p))
-				BADLINE();
+				break;
 
 			q = p;
 			while (*p && *p != ';' && *p != '}' && !isspace(*p))
 				p++;
 			if (!(*p))
-				BADLINE();
+				break;
 			if (*p == '}')
 				islist = 0;
 			oldc = *p;
@@ -153,6 +154,8 @@ static int load_users(struct policydb *p
 					}
 			}
 		} while (islist);
+		if (oldc == 0)
+			BADLINE();
 
 		if (policydb->mls) {
 			context_struct_t context;
libsepol/src/hierarchy.c +4 -7
Index: trunk/libsepol/src/hierarchy.c
===================================================================
@@ -130,7 +130,7 @@ static int check_avtab_hierarchy_callbac
 	avtab_key_t key;
 	avtab_datum_t *avdatump;
 	hierarchy_args_t *a;
-	uint32_t av;
+	uint32_t av = 0;
 	type_datum_t *t = NULL, *t2 = NULL;
 
 	if (!(k->specified & AVTAB_ALLOWED)) {
@@ -164,8 +164,7 @@ static int check_avtab_hierarchy_callbac
 				return 0;
 			}
 			av = avdatump->data;
-		} else
-			av = 0;
+		}
 		if (a->opt_cond_list) {
 			/* if a conditional list is present search it before continuing */
 			avdatump = cond_av_list_search(&key, a->opt_cond_list);
@@ -202,8 +201,7 @@ static int check_avtab_hierarchy_callbac
 				return 0;
 			}
 			av = avdatump->data;
-		} else
-			av = 0;
+		}
 		if (a->opt_cond_list) {
 			/* if a conditional list is present search it before continuing */
 			avdatump = cond_av_list_search(&key, a->opt_cond_list);
@@ -228,8 +226,7 @@ static int check_avtab_hierarchy_callbac
 				return 0;
 			}
 			av = avdatump->data;
-		} else
-			av = 0;
+		}
 		if (a->opt_cond_list) {
 			/* if a conditional list is present search it before continuing */
 			avdatump = cond_av_list_search(&key, a->opt_cond_list);
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#6 lore raw

PATCH 6/7 quiet policycoreutils warnings

In reply to [email protected]

Avoid using "log" as a variable name, it conflicts with the gcc log() builtin.

Fix gcc uninitialized variable warning false positives.

---
 policycoreutils/audit2why/audit2why.c         |    2 +-
 policycoreutils/semodule/semodule.c           |    4 ++--
 policycoreutils/semodule_deps/semodule_deps.c |   23 +++++++++++++----------
 policycoreutils/setfiles/setfiles.c           |    6 +++---
 4 files changed, 19 insertions(+), 16 deletions(-)
policycoreutils/audit2why/audit2why.c +1 -1
Index: trunk/policycoreutils/audit2why/audit2why.c
===================================================================
@@ -28,7 +28,7 @@ int main(int argc, char **argv)
 	char *buffer = NULL, *bufcopy = NULL;
 	unsigned int lineno = 0;
 	size_t len = 0, bufcopy_len = 0;
-	FILE *fp;
+	FILE *fp = NULL;
 	int opt, rc, set_path = 0;
 	char *p, *scon, *tcon, *tclassstr, *permstr;
 	sepol_security_id_t ssid, tsid;
policycoreutils/semodule/semodule.c +2 -2
Index: trunk/policycoreutils/semodule/semodule.c
===================================================================
@@ -339,8 +339,8 @@ int main(int argc, char *argv[])
 	for (i = 0; i < num_commands; i++) {
 		enum client_modes mode = commands[i].mode;
 		char *mode_arg = commands[i].arg;
-		char *data;
-		size_t data_len;
+		char *data = NULL;
+		size_t data_len = 0;
 		if (mode == INSTALL_M || mode == UPGRADE_M || mode == BASE_M) {
 			if ((data_len = map_file(mode_arg, &data)) == 0) {
 				fprintf(stderr,
policycoreutils/semodule_deps/semodule_deps.c +13 -10
Index: trunk/policycoreutils/semodule_deps/semodule_deps.c
===================================================================
@@ -139,7 +139,7 @@ static sepol_module_package_t *load_modu
  *           of the policy.
  *  - levels / cats: can't be required or used in modules.
  */
-static int generate_requires(policydb_t * p, hashtab_t * r)
+static hashtab_t generate_requires(policydb_t * p)
 {
 	avrule_block_t *block;
 	avrule_decl_t *decl;
@@ -154,7 +154,7 @@ static int generate_requires(policydb_t 
 
 	mods = hashtab_create(reqsymhash, reqsymcmp, 64);
 	if (mods == NULL)
-		return -1;
+		return NULL;
 
 	for (block = p->global; block != NULL; block = block->next) {
 		if (block->flags & AVRULE_OPTIONAL)
@@ -196,14 +196,14 @@ static int generate_requires(policydb_t 
 								   reqsymcmp,
 								   64);
 						if (reqs == NULL) {
-							return -1;
+							return NULL;
 						}
 						ret =
 						    hashtab_insert(mods,
 								   mod_name,
 								   reqs);
 						if (ret != SEPOL_OK)
-							return ret;
+							return NULL;
 					}
 					ret =
 					    hashtab_insert(reqs, req_name,
@@ -211,16 +211,14 @@ static int generate_requires(policydb_t 
 					if (!
 					    (ret == SEPOL_EEXIST
 					     || ret == SEPOL_OK))
-						return -1;
+						return NULL;
 				}
 			}
 
 		}
 	}
 
-	*r = mods;
-
-	return 0;
+	return mods;
 }
 
 static void free_requires(hashtab_t req)
@@ -323,6 +321,7 @@ int main(int argc, char **argv)
 	int verbose = 0, exclude_base = 1, command = SHOW_DEPS;
 	char *basename;
 	sepol_module_package_t *base, **mods;
+	policydb_t *p;
 	hashtab_t req;
 
 	while ((ch = getopt(argc, argv, "vgb")) != EOF) {
@@ -383,8 +382,12 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
-	if (generate_requires
-	    ((policydb_t *) sepol_module_package_get_policy(base), &req) < 0)
+	p = (policydb_t *) sepol_module_package_get_policy(base);
+	if (p == NULL)
+		exit(1);
+
+	req = generate_requires(p);
+	if (req == NULL)
 		exit(1);
 
 	if (command == SHOW_DEPS)
policycoreutils/setfiles/setfiles.c +3 -3
Index: trunk/policycoreutils/setfiles/setfiles.c
===================================================================
@@ -53,7 +53,7 @@ static int change = 1;
 static int quiet = 0;
 static int ignore_enoent;
 static int verbose = 0;
-static int log = 0;
+static int logging = 0;
 static int warn_no_match = 0;
 static char *rootpath = NULL;
 static int rootpathlen = 0;
@@ -519,7 +519,7 @@ static int restore(const char *file)
 		}
 	}
 
-	if (log && !user_only_changed) {
+	if (logging && !user_only_changed) {
 		if (context)
 			syslog(LOG_INFO, "relabeling %s from %s to %s\n",
 			       my_file, context, newcon);
@@ -858,7 +858,7 @@ int main(int argc, char **argv)
 			ignore_enoent = 1;
 			break;
 		case 'l':
-			log = 1;
+			logging = 1;
 			break;
 		case 'F':
 			force = 1;
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#7 lore raw

PATCH 7/7 Use -Werror

In reply to [email protected]

Add -Werror to Makefiles

---
 checkpolicy/Makefile                      |    2 +-
 libselinux/src/Makefile                   |    2 +-
 libsemanage/src/Makefile                  |    2 +-
 libsepol/src/Makefile                     |    2 +-
 policycoreutils/audit2why/Makefile        |    2 +-
 policycoreutils/load_policy/Makefile      |    2 +-
 policycoreutils/newrole/Makefile          |    2 +-
 policycoreutils/restorecond/Makefile      |    2 +-
 policycoreutils/run_init/Makefile         |    2 +-
 policycoreutils/secon/Makefile            |    2 +-
 policycoreutils/semodule/Makefile         |    2 +-
 policycoreutils/semodule_deps/Makefile    |    2 +-
 policycoreutils/semodule_expand/Makefile  |    2 +-
 policycoreutils/semodule_link/Makefile    |    2 +-
 policycoreutils/semodule_package/Makefile |    2 +-
 policycoreutils/sestatus/Makefile         |    2 +-
 policycoreutils/setfiles/Makefile         |    2 +-
 policycoreutils/setsebool/Makefile        |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)
checkpolicy/Makefile +1 -1
Index: trunk/checkpolicy/Makefile
===================================================================
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall -Werror -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 
libselinux/src/Makefile +1 -1
Index: trunk/libselinux/src/Makefile
===================================================================
@@ -32,7 +32,7 @@ SRCS= $(filter-out $(UNUSED_SRCS), $(fil
 
 OBJS= $(patsubst %.c,%.o,$(SRCS))
 LOBJS= $(patsubst %.c,%.lo,$(SRCS))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS)
 RANLIB=ranlib
 
libsemanage/src/Makefile +1 -1
Index: trunk/libsemanage/src/Makefile
===================================================================
@@ -31,7 +31,7 @@ SWIGFILES=$(SWIGSO) semanage.py 
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.o conf-parse.o
 LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.lo conf-parse.lo
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+CFLAGS ?= -Wall -W Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
 
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
 
libsepol/src/Makefile +1 -1
Index: trunk/libsepol/src/Makefile
===================================================================
@@ -10,7 +10,7 @@ TARGET=libsepol.so
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO)
policycoreutils/audit2why/Makefile +1 -1
Index: trunk/policycoreutils/audit2why/Makefile
===================================================================
@@ -7,7 +7,7 @@ LOCALEDIR ?= /usr/share/locale
 INCLUDEDIR ?= ${PREFIX}/include
 
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = ${LIBDIR}/libsepol.a -lselinux -L$(LIBDIR)
 
policycoreutils/load_policy/Makefile +1 -1
Index: trunk/policycoreutils/load_policy/Makefile
===================================================================
@@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib
 
policycoreutils/newrole/Makefile +1 -1
Index: trunk/policycoreutils/newrole/Makefile
===================================================================
@@ -20,7 +20,7 @@ NAMESPACE_PRIV ?= n
 LSPP_PRIV ?= n
 VERSION = $(shell cat ../VERSION)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 EXTRA_OBJS =
 override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib
policycoreutils/restorecond/Makefile +1 -1
Index: trunk/policycoreutils/restorecond/Makefile
===================================================================
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 INITDIR = $(DESTDIR)/etc/rc.d/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
-CFLAGS ?= -g -Werror -Wall -W
+CFLAGS ?= -g -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS += -lselinux -L$(PREFIX)/lib
 
policycoreutils/run_init/Makefile +1 -1
Index: trunk/policycoreutils/run_init/Makefile
===================================================================
@@ -8,7 +8,7 @@ LOCALEDIR ?= /usr/share/locale
 PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib
 ifeq (${PAMH}, /usr/include/security/pam_appl.h)
policycoreutils/secon/Makefile +1 -1
Index: trunk/policycoreutils/secon/Makefile
===================================================================
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
+WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal -Werror
 VERSION = $(shell cat ../VERSION)
 CFLAGS ?= $(WARNS) -O1
 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) 
policycoreutils/semodule/Makefile +1 -1
Index: trunk/policycoreutils/semodule/Makefile
===================================================================
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SEMODULE_OBJS = semodule.o
policycoreutils/semodule_deps/Makefile +1 -1
Index: trunk/policycoreutils/semodule_deps/Makefile
===================================================================
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = $(LIBDIR)/libsepol.a
 
policycoreutils/semodule_expand/Makefile +1 -1
Index: trunk/policycoreutils/semodule_expand/Makefile
===================================================================
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 
policycoreutils/semodule_link/Makefile +1 -1
Index: trunk/policycoreutils/semodule_link/Makefile
===================================================================
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 
policycoreutils/semodule_package/Makefile +1 -1
Index: trunk/policycoreutils/semodule_package/Makefile
===================================================================
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 
policycoreutils/sestatus/Makefile +1 -1
Index: trunk/policycoreutils/sestatus/Makefile
===================================================================
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS = -lselinux -L$(LIBDIR)
 
policycoreutils/setfiles/Makefile +1 -1
Index: trunk/policycoreutils/setfiles/Makefile
===================================================================
@@ -6,7 +6,7 @@ LIBDIR ?= $(PREFIX)/lib
 
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W 
+CFLAGS = -Werror -Wall -W  -Werror
 override CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 
policycoreutils/setsebool/Makefile +1 -1
Index: trunk/policycoreutils/setsebool/Makefile
===================================================================
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SETSEBOOL_OBJS = setsebool.o
Signature · 4 lines
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#8 lore raw

Re: [patch 7/7] Use -Werror

Quoted 2 lines · On Thu, 2008-01-03 at 13:43 -0500, [email protected] wrote:

plain text document attachment (Werror.patch)
Add -Werror to Makefiles

A bit overzealous though - some of them already had -Werror in CFLAGS.

Otherwise, looks fine.

Quoted 257 lines
---
 checkpolicy/Makefile                      |    2 +-
 libselinux/src/Makefile                   |    2 +-
 libsemanage/src/Makefile                  |    2 +-
 libsepol/src/Makefile                     |    2 +-
 policycoreutils/audit2why/Makefile        |    2 +-
 policycoreutils/load_policy/Makefile      |    2 +-
 policycoreutils/newrole/Makefile          |    2 +-
 policycoreutils/restorecond/Makefile      |    2 +-
 policycoreutils/run_init/Makefile         |    2 +-
 policycoreutils/secon/Makefile            |    2 +-
 policycoreutils/semodule/Makefile         |    2 +-
 policycoreutils/semodule_deps/Makefile    |    2 +-
 policycoreutils/semodule_expand/Makefile  |    2 +-
 policycoreutils/semodule_link/Makefile    |    2 +-
 policycoreutils/semodule_package/Makefile |    2 +-
 policycoreutils/sestatus/Makefile         |    2 +-
 policycoreutils/setfiles/Makefile         |    2 +-
 policycoreutils/setsebool/Makefile        |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

Index: trunk/checkpolicy/Makefile
===================================================================

checkpolicy/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall -Werror -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 

Index: trunk/libselinux/src/Makefile
===================================================================

libselinux/src/Makefile +1 -1
@@ -32,7 +32,7 @@ SRCS= $(filter-out $(UNUSED_SRCS), $(fil
 
 OBJS= $(patsubst %.c,%.o,$(SRCS))
 LOBJS= $(patsubst %.c,%.lo,$(SRCS))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS)
 RANLIB=ranlib
 

Index: trunk/libsemanage/src/Makefile
===================================================================

libsemanage/src/Makefile +1 -1
@@ -31,7 +31,7 @@ SWIGFILES=$(SWIGSO) semanage.py 
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.o conf-parse.o
 LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.lo conf-parse.lo
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+CFLAGS ?= -Wall -W Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
 
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
 

Index: trunk/libsepol/src/Makefile
===================================================================

libsepol/src/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGET=libsepol.so
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO)

Index: trunk/policycoreutils/audit2why/Makefile
===================================================================

policycoreutils/audit2why/Makefile +1 -1
@@ -7,7 +7,7 @@ LOCALEDIR ?= /usr/share/locale
 INCLUDEDIR ?= ${PREFIX}/include
 
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = ${LIBDIR}/libsepol.a -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/load_policy/Makefile
===================================================================

policycoreutils/load_policy/Makefile +1 -1
@@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/newrole/Makefile
===================================================================

policycoreutils/newrole/Makefile +1 -1
@@ -20,7 +20,7 @@ NAMESPACE_PRIV ?= n
 LSPP_PRIV ?= n
 VERSION = $(shell cat ../VERSION)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 EXTRA_OBJS =
 override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib

Index: trunk/policycoreutils/restorecond/Makefile
===================================================================

policycoreutils/restorecond/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 INITDIR = $(DESTDIR)/etc/rc.d/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
-CFLAGS ?= -g -Werror -Wall -W
+CFLAGS ?= -g -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS += -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/run_init/Makefile
===================================================================

policycoreutils/run_init/Makefile +1 -1
@@ -8,7 +8,7 @@ LOCALEDIR ?= /usr/share/locale
 PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib
 ifeq (${PAMH}, /usr/include/security/pam_appl.h)

Index: trunk/policycoreutils/secon/Makefile
===================================================================

policycoreutils/secon/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
+WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal -Werror
 VERSION = $(shell cat ../VERSION)
 CFLAGS ?= $(WARNS) -O1
 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) 

Index: trunk/policycoreutils/semodule/Makefile
===================================================================

policycoreutils/semodule/Makefile +1 -1
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SEMODULE_OBJS = semodule.o

Index: trunk/policycoreutils/semodule_deps/Makefile
===================================================================

policycoreutils/semodule_deps/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = $(LIBDIR)/libsepol.a
 

Index: trunk/policycoreutils/semodule_expand/Makefile
===================================================================

policycoreutils/semodule_expand/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_link/Makefile
===================================================================

policycoreutils/semodule_link/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_package/Makefile
===================================================================

policycoreutils/semodule_package/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/sestatus/Makefile
===================================================================

policycoreutils/sestatus/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS = -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/setfiles/Makefile
===================================================================

policycoreutils/setfiles/Makefile +1 -1
@@ -6,7 +6,7 @@ LIBDIR ?= $(PREFIX)/lib
 
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W 
+CFLAGS = -Werror -Wall -W  -Werror
 override CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 

Index: trunk/policycoreutils/setsebool/Makefile
===================================================================

policycoreutils/setsebool/Makefile +1 -1
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SETSEBOOL_OBJS = setsebool.o
Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#9 lore raw

Re: [patch 7/7] Use -Werror

Quoted 7 lines · Stephen Smalley
Quoted 2 lines · On Thu, 2008-01-03 at 13:43 -0500, [email protected] wrote:

plain text document attachment (Werror.patch)
Add -Werror to Makefiles

A bit overzealous though - some of them already had -Werror in CFLAGS.

Otherwise, looks fine.

Is there a good reason we have CFLAGS per Makefile instead of once at the top level? I use DEBUG=1 most of the time and everything builds fine with a common set.

Quoted 251 lines
Quoted 251 lines
---
 checkpolicy/Makefile                      |    2 +-
 libselinux/src/Makefile                   |    2 +-
 libsemanage/src/Makefile                  |    2 +-
 libsepol/src/Makefile                     |    2 +-
 policycoreutils/audit2why/Makefile        |    2 +-
 policycoreutils/load_policy/Makefile      |    2 +-
 policycoreutils/newrole/Makefile          |    2 +-
 policycoreutils/restorecond/Makefile      |    2 +-
 policycoreutils/run_init/Makefile         |    2 +-
 policycoreutils/secon/Makefile            |    2 +-
 policycoreutils/semodule/Makefile         |    2 +-
 policycoreutils/semodule_deps/Makefile    |    2 +-
 policycoreutils/semodule_expand/Makefile  |    2 +-
 policycoreutils/semodule_link/Makefile    |    2 +-
 policycoreutils/semodule_package/Makefile |    2 +-
 policycoreutils/sestatus/Makefile         |    2 +-
 policycoreutils/setfiles/Makefile         |    2 +-
 policycoreutils/setsebool/Makefile        |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

Index: trunk/checkpolicy/Makefile
===================================================================

checkpolicy/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall -Werror -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 

Index: trunk/libselinux/src/Makefile
===================================================================

libselinux/src/Makefile +1 -1
@@ -32,7 +32,7 @@ SRCS= $(filter-out $(UNUSED_SRCS), $(fil
 
 OBJS= $(patsubst %.c,%.o,$(SRCS))
 LOBJS= $(patsubst %.c,%.lo,$(SRCS))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS)
 RANLIB=ranlib
 

Index: trunk/libsemanage/src/Makefile
===================================================================

libsemanage/src/Makefile +1 -1
@@ -31,7 +31,7 @@ SWIGFILES=$(SWIGSO) semanage.py 
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.o conf-parse.o
 LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.lo conf-parse.lo
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+CFLAGS ?= -Wall -W Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
 
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
 

Index: trunk/libsepol/src/Makefile
===================================================================

libsepol/src/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGET=libsepol.so
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO)

Index: trunk/policycoreutils/audit2why/Makefile
===================================================================

policycoreutils/audit2why/Makefile +1 -1
@@ -7,7 +7,7 @@ LOCALEDIR ?= /usr/share/locale
 INCLUDEDIR ?= ${PREFIX}/include
 
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = ${LIBDIR}/libsepol.a -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/load_policy/Makefile
===================================================================

policycoreutils/load_policy/Makefile +1 -1
@@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/newrole/Makefile
===================================================================

policycoreutils/newrole/Makefile +1 -1
@@ -20,7 +20,7 @@ NAMESPACE_PRIV ?= n
 LSPP_PRIV ?= n
 VERSION = $(shell cat ../VERSION)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 EXTRA_OBJS =
 override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib

Index: trunk/policycoreutils/restorecond/Makefile
===================================================================

policycoreutils/restorecond/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 INITDIR = $(DESTDIR)/etc/rc.d/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
-CFLAGS ?= -g -Werror -Wall -W
+CFLAGS ?= -g -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS += -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/run_init/Makefile
===================================================================

policycoreutils/run_init/Makefile +1 -1
@@ -8,7 +8,7 @@ LOCALEDIR ?= /usr/share/locale
 PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib
 ifeq (${PAMH}, /usr/include/security/pam_appl.h)

Index: trunk/policycoreutils/secon/Makefile
===================================================================

policycoreutils/secon/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
+WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal -Werror
 VERSION = $(shell cat ../VERSION)
 CFLAGS ?= $(WARNS) -O1
 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) 

Index: trunk/policycoreutils/semodule/Makefile
===================================================================

policycoreutils/semodule/Makefile +1 -1
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SEMODULE_OBJS = semodule.o

Index: trunk/policycoreutils/semodule_deps/Makefile
===================================================================

policycoreutils/semodule_deps/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = $(LIBDIR)/libsepol.a
 

Index: trunk/policycoreutils/semodule_expand/Makefile
===================================================================

policycoreutils/semodule_expand/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_link/Makefile
===================================================================

policycoreutils/semodule_link/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_package/Makefile
===================================================================

policycoreutils/semodule_package/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/sestatus/Makefile
===================================================================

policycoreutils/sestatus/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS = -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/setfiles/Makefile
===================================================================

policycoreutils/setfiles/Makefile +1 -1
@@ -6,7 +6,7 @@ LIBDIR ?= $(PREFIX)/lib
 
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W 
+CFLAGS = -Werror -Wall -W  -Werror
 override CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 

Index: trunk/policycoreutils/setsebool/Makefile
===================================================================

policycoreutils/setsebool/Makefile +0 -0
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
Quoted 6 lines

policycoreutils/setsebool/Makefile SBINDIR ?= $(PREFIX)/sbin · line 11

Quoted 6 lines
policycoreutils/setsebool/Makefile +1 -1
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SETSEBOOL_OBJS = setsebool.o

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.

#10 lore raw

Re: [patch 7/7] Use -Werror

Quoted 5 lines · Joshua Brindle
Quoted 4 lines · Stephen Smalley
Quoted 2 lines · On Thu, 2008-01-03 at 13:43 -0500, [email protected] wrote:

plain text document attachment (Werror.patch)
Add -Werror to Makefiles

Quoted 7 lines
Quoted 3 lines

A bit overzealous though - some of them already had -Werror in CFLAGS.

Otherwise, looks fine.

Is there a good reason we have CFLAGS per Makefile instead of once at the top level? I use DEBUG=1 most of the time and everything builds fine with a common set.

Mostly because the components are released as individual tar balls and packages, w/o the top level Makefile altogether.

Also need to make sure that -Werror gets included by make DEBUG=1 then.

Quoted 258 lines
Quoted 257 lines
Quoted 257 lines
---
 checkpolicy/Makefile                      |    2 +-
 libselinux/src/Makefile                   |    2 +-
 libsemanage/src/Makefile                  |    2 +-
 libsepol/src/Makefile                     |    2 +-
 policycoreutils/audit2why/Makefile        |    2 +-
 policycoreutils/load_policy/Makefile      |    2 +-
 policycoreutils/newrole/Makefile          |    2 +-
 policycoreutils/restorecond/Makefile      |    2 +-
 policycoreutils/run_init/Makefile         |    2 +-
 policycoreutils/secon/Makefile            |    2 +-
 policycoreutils/semodule/Makefile         |    2 +-
 policycoreutils/semodule_deps/Makefile    |    2 +-
 policycoreutils/semodule_expand/Makefile  |    2 +-
 policycoreutils/semodule_link/Makefile    |    2 +-
 policycoreutils/semodule_package/Makefile |    2 +-
 policycoreutils/sestatus/Makefile         |    2 +-
 policycoreutils/setfiles/Makefile         |    2 +-
 policycoreutils/setsebool/Makefile        |    2 +-
 18 files changed, 18 insertions(+), 18 deletions(-)

Index: trunk/checkpolicy/Makefile
===================================================================

checkpolicy/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall -Werror -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 

Index: trunk/libselinux/src/Makefile
===================================================================

libselinux/src/Makefile +1 -1
@@ -32,7 +32,7 @@ SRCS= $(filter-out $(UNUSED_SRCS), $(fil
 
 OBJS= $(patsubst %.c,%.o,$(SRCS))
 LOBJS= $(patsubst %.c,%.lo,$(SRCS))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 $(EMFLAGS)
 RANLIB=ranlib
 

Index: trunk/libsemanage/src/Makefile
===================================================================

libsemanage/src/Makefile +1 -1
@@ -31,7 +31,7 @@ SWIGFILES=$(SWIGSO) semanage.py 
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.o conf-parse.o
 LOBJS= $(patsubst %.c,%.lo,$(filter-out $(SWIGCOUT),$(wildcard *.c))) conf-scan.lo conf-parse.lo
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
+CFLAGS ?= -Wall -W Wundef -Wmissing-noreturn -Wmissing-format-attribute -Wno-unused-parameter
 
 override CFLAGS += -I../include -I$(INCLUDEDIR) -D_GNU_SOURCE 
 

Index: trunk/libsepol/src/Makefile
===================================================================

libsepol/src/Makefile +1 -1
@@ -10,7 +10,7 @@ TARGET=libsepol.so
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?= -Wall -W -Wundef -Wmissing-noreturn -Wmissing-format-attribute -Werror
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO)

Index: trunk/policycoreutils/audit2why/Makefile
===================================================================

policycoreutils/audit2why/Makefile +1 -1
@@ -7,7 +7,7 @@ LOCALEDIR ?= /usr/share/locale
 INCLUDEDIR ?= ${PREFIX}/include
 
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = ${LIBDIR}/libsepol.a -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/load_policy/Makefile
===================================================================

policycoreutils/load_policy/Makefile +1 -1
@@ -4,7 +4,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR ?= $(PREFIX)/share/man
 LOCALEDIR ?= /usr/share/locale
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lsepol -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/newrole/Makefile
===================================================================

policycoreutils/newrole/Makefile +1 -1
@@ -20,7 +20,7 @@ NAMESPACE_PRIV ?= n
 LSPP_PRIV ?= n
 VERSION = $(shell cat ../VERSION)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 EXTRA_OBJS =
 override CFLAGS += -DVERSION=\"$(VERSION)\" $(LDFLAGS) -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib

Index: trunk/policycoreutils/restorecond/Makefile
===================================================================

policycoreutils/restorecond/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 INITDIR = $(DESTDIR)/etc/rc.d/init.d
 SELINUXDIR = $(DESTDIR)/etc/selinux
 
-CFLAGS ?= -g -Werror -Wall -W
+CFLAGS ?= -g -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS += -lselinux -L$(PREFIX)/lib
 

Index: trunk/policycoreutils/run_init/Makefile
===================================================================

policycoreutils/run_init/Makefile +1 -1
@@ -8,7 +8,7 @@ LOCALEDIR ?= /usr/share/locale
 PAMH = $(shell ls /usr/include/security/pam_appl.h 2>/dev/null)
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -DUSE_NLS -DLOCALEDIR="\"$(LOCALEDIR)\"" -DPACKAGE="\"policycoreutils\""
 LDLIBS += -lselinux -L$(PREFIX)/lib
 ifeq (${PAMH}, /usr/include/security/pam_appl.h)

Index: trunk/policycoreutils/secon/Makefile
===================================================================

policycoreutils/secon/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal
+WARNS=-W -Wall -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wno-format-zero-length -Wformat-nonliteral -Wformat-security -Wfloat-equal -Werror
 VERSION = $(shell cat ../VERSION)
 CFLAGS ?= $(WARNS) -O1
 override CFLAGS += -DVERSION=\"$(VERSION)\" -I$(INCLUDEDIR) 

Index: trunk/policycoreutils/semodule/Makefile
===================================================================

policycoreutils/semodule/Makefile +1 -1
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SEMODULE_OBJS = semodule.o

Index: trunk/policycoreutils/semodule_deps/Makefile
===================================================================

policycoreutils/semodule_deps/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = $(LIBDIR)/libsepol.a
 

Index: trunk/policycoreutils/semodule_expand/Makefile
===================================================================

policycoreutils/semodule_expand/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_link/Makefile
===================================================================

policycoreutils/semodule_link/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 MANDIR ?= $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/semodule_package/Makefile
===================================================================

policycoreutils/semodule_package/Makefile +1 -1
@@ -5,7 +5,7 @@ BINDIR ?= $(PREFIX)/bin
 LIBDIR ?= ${PREFIX}/lib
 MANDIR ?= $(PREFIX)/share/man
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/sestatus/Makefile
===================================================================

policycoreutils/sestatus/Makefile +1 -1
@@ -5,7 +5,7 @@ MANDIR = $(PREFIX)/share/man
 ETCDIR ?= $(DESTDIR)/etc
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS = -Werror -Wall -W
+CFLAGS = -Werror -Wall -W -Werror
 override CFLAGS += -I$(PREFIX)/include -D_FILE_OFFSET_BITS=64
 LDLIBS = -lselinux -L$(LIBDIR)
 

Index: trunk/policycoreutils/setfiles/Makefile
===================================================================

policycoreutils/setfiles/Makefile +1 -1
@@ -6,7 +6,7 @@ LIBDIR ?= $(PREFIX)/lib
 
 AUDITH = $(shell ls /usr/include/libaudit.h 2>/dev/null)
 
-CFLAGS = -Werror -Wall -W 
+CFLAGS = -Werror -Wall -W  -Werror
 override CFLAGS += -D_FILE_OFFSET_BITS=64 -I$(PREFIX)/include
 LDLIBS = -lselinux -lsepol -L$(LIBDIR)
 

Index: trunk/policycoreutils/setsebool/Makefile
===================================================================

policycoreutils/setsebool/Makefile +1 -1
@@ -5,7 +5,7 @@ SBINDIR ?= $(PREFIX)/sbin
 MANDIR = $(PREFIX)/share/man
 LIBDIR ?= ${PREFIX}/lib
 
-CFLAGS ?= -Werror -Wall -W
+CFLAGS ?= -Werror -Wall -W -Werror
 override CFLAGS += -I$(INCLUDEDIR)
 LDLIBS = -lsepol -lselinux -lsemanage -L$(LIBDIR)
 SETSEBOOL_OBJS = setsebool.o
Signature · 8 lines
Stephen Smalley
National Security Agency


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
author Applied
#11 lore raw
In reply to [email protected]
Quoted 5 lines · [email protected] wrote:

These patches fix a number of gcc warnings in the selinux userland build process. They allow everything but libsemanage to build with -Werror. The only thing in the way of libsemanage using -Werror is the flex-generated scanner. We could just drop a few of the -W flags for libsemanage (like -Wundef) to make it pass.

Merged into the stable and policyrep branches.

- todd

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.