Skip to contentSkip to conversation

Fix build error with gcc (GCC) 4.6.0 20100416 (experimental)

PATCH In review Justin P. Mattock 2 participants 2 messages May 8, 2010 – May 10, 2010 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix build error with gcc (GCC) 4.6.0 20100416 (experimental)

When compiling userspace tools with
(GCC) 4.6.0 20100416 I'm getting this error:

booleans.c: In function 'sepol_bool_count':
booleans.c:106:39: error: parameter 'handle' set but not used
cc1: all warnings being treated as errors

This patch is a temporary fix and/or perminent
(depending on what you guys decide).

---
 checkpolicy/Makefile    |    2 +-
 libsepol/src/Makefile   |    2 +-
 libsepol/utils/Makefile |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
checkpolicy/Makefile +1 -1
index e5fae3d..34fa857 100644
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -Werror -Wshadow -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall  -Wshadow -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 
libsepol/src/Makefile +1 -1
index 73fdef8..be0d4d8 100644
@@ -14,7 +14,7 @@ LIBPC=libsepol.pc
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?=  -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
libsepol/utils/Makefile +1 -1
index 6864114..9985cf6 100644
@@ -2,7 +2,7 @@
 PREFIX ?= $(DESTDIR)/usr
 BINDIR ?= $(PREFIX)/bin
 
-CFLAGS ?= -Wall -Werror
+CFLAGS ?= -Wall 
 override CFLAGS += -I../include
 LDLIBS += -L../src -lsepol 
 
Signature · 7 lines
1.7.1.rc1.21.gf3bd6


--
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
Quoted 9 lines · Justin P. Mattock

When compiling userspace tools with
(GCC) 4.6.0 20100416 I'm getting this error:

booleans.c: In function 'sepol_bool_count':
booleans.c:106:39: error: parameter 'handle' set but not used
cc1: all warnings being treated as errors

This patch is a temporary fix and/or perminent
(depending on what you guys decide).

Removing -Werror isn't a "fix". To fix, add __attribute__((unused)) as appropriate.

Quoted 49 lines
---
 checkpolicy/Makefile    |    2 +-
 libsepol/src/Makefile   |    2 +-
 libsepol/utils/Makefile |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
checkpolicy/Makefile +1 -1
index e5fae3d..34fa857 100644
@@ -10,7 +10,7 @@ TARGETS = checkpolicy checkmodule
 
 YACC = bison -y
 
-CFLAGS ?= -g -Wall -Werror -Wshadow -O2 -pipe -fno-strict-aliasing
+CFLAGS ?= -g -Wall  -Wshadow -O2 -pipe -fno-strict-aliasing
 
 override CFLAGS += -I. -I${INCLUDEDIR}
 
libsepol/src/Makefile +1 -1
index 73fdef8..be0d4d8 100644
@@ -14,7 +14,7 @@ LIBPC=libsepol.pc
 LIBSO=$(TARGET).$(LIBVERSION)
 OBJS= $(patsubst %.c,%.o,$(wildcard *.c))
 LOBJS= $(patsubst %.c,%.lo,$(wildcard *.c))
-CFLAGS ?= -Werror -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute
+CFLAGS ?=  -Wall -W -Wundef -Wshadow -Wmissing-noreturn -Wmissing-format-attribute
 override CFLAGS += -I. -I../include -D_GNU_SOURCE
 
 all: $(LIBA) $(LIBSO) $(LIBPC)
libsepol/utils/Makefile +1 -1
index 6864114..9985cf6 100644
@@ -2,7 +2,7 @@
 PREFIX ?= $(DESTDIR)/usr
 BINDIR ?= $(PREFIX)/bin
 
-CFLAGS ?= -Wall -Werror
+CFLAGS ?= -Wall 
 override CFLAGS += -I../include
 LDLIBS += -L../src -lsepol 
 
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.