From 51ece42ab438295d3807180dae34963c676f170a Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Sun, 22 Nov 2009 14:17:19 -0500 Subject: [PATCH] Remove "unused" warnings from lex generated files Some (f)lex generated source files produce warnings because of unused labels or variables. Since there is limited control of the source itself, just be more permissive in this particular case with -Wno-unused. Change-Id: Ice25019f8a592a25f5084e88119b68846d900033 Reviewed-on: http://gerrit.openafs.org/867 Tested-by: Marc Dionne Reviewed-by: Derrick Brashear --- README.WARNINGS | 2 -- src/cf/osconf.m4 | 7 +++++++ src/comerr/Makefile.in | 2 +- src/uss/Makefile.in | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.WARNINGS b/README.WARNINGS index 89b195dba..ca3ecccfd 100644 --- a/README.WARNINGS +++ b/README.WARNINGS @@ -53,7 +53,6 @@ bucoord/commands.c : all : Ubik_Call : signed vs unsigned for dates butc/tcmain.c : all : prototypes butc/tcudbprocs.c : all : ubik_Call -comerr/error_table.c : all : Autogenerated file with unused labels kauth/admin_tools.c : all : ubik_Call nonsense kauth/authclient.c : strict-proto : ubik_Call nonsense libadmin/bos/afs_bosAdmin.c: all : DES keys, time types, and const @@ -73,7 +72,6 @@ ubik/beacon.c : all : Ubik uses signed/unsigned ubik/ubikclient.c : strict-protos : ubik_Call uss/uss_vol.c : all Format issues uss/uss_kauth.c : all : Des keys, ubik_Call -uss/lex.yy.c : all : Unused symbols viced/fsprobe.c : all : ubik_Call vol/salvager.c : all : consts & undefined variable from header - maybe fixed! volser/vol-dump.c : format : afs_sfsize_t diff --git a/src/cf/osconf.m4 b/src/cf/osconf.m4 index c61a57d2a..9fdf142b2 100644 --- a/src/cf/osconf.m4 +++ b/src/cf/osconf.m4 @@ -1195,6 +1195,12 @@ if test "x$GCC" = "xyes"; then fi fi +if test "x$GCC" = "xyes"; then + CFLAGS_NOUNUSED="-Wno-unused" +else + CFLAGS_NOUNUSED= +fi + dnl horribly cheating, assuming double / is ok. case $INSTALL in ./* ) @@ -1245,6 +1251,7 @@ AC_SUBST(TXLIBS) AC_SUBST(VFSCK_CFLAGS) AC_SUBST(XCFLAGS) AC_SUBST(CFLAGS_NOERROR) +AC_SUBST(CFLAGS_NOUNUSED) AC_SUBST(XCFLAGS64) AC_SUBST(XLDFLAGS) AC_SUBST(XLDFLAGS64) diff --git a/src/comerr/Makefile.in b/src/comerr/Makefile.in index d3b4a49e1..26b202c7e 100644 --- a/src/comerr/Makefile.in +++ b/src/comerr/Makefile.in @@ -47,7 +47,7 @@ libcom_err.a: error_msg.o et_name.o com_err.o AFS_component_version_number.o # so we need to add the source directory to the includes to pick up local headers. # error_table.o: error_table.c - $(CC) $(CFLAGS) -I${srcdir} @CFLAGS_NOERROR@ -c $< + $(CC) $(CFLAGS) -I${srcdir} @CFLAGS_NOUNUSED@ -c $< # # Installation targets diff --git a/src/uss/Makefile.in b/src/uss/Makefile.in index dffc21a1d..f5d25638c 100644 --- a/src/uss/Makefile.in +++ b/src/uss/Makefile.in @@ -74,7 +74,7 @@ uss_fs.o : uss_fs.c ${CC} -c ${CFLAGS} ${srcdir}/uss_fs.c lex.yy.o : lex.yy.c y.tab.c - ${CC} -c ${CFLAGS} @CFLAGS_NOERROR@ lex.yy.c + ${CC} -c ${CFLAGS} @CFLAGS_NOUNUSED@ lex.yy.c lex.yy.c : lex.l ${LEX} ${srcdir}/lex.l -- 2.39.5