ATF-devel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: -Werror=unused-but-set-variable
On 08/11/2011 04:31 PM, Julio Merino wrote:
>
> Well, if the default was false we wouldn't have found these problems ;-)
Right, painful but right. :)
> And I doubt that anyone will do --enable-developer at all if the
> default is false.
Well, when the developers are in 'cleaning code' mode, this option will
definitely be helpful...
> That said, I know that -Werror is problematic for end users. An
> alternative would be to only enable -Werror on HEAD and disable it in
> all formal releases. I am now thinking that disabling -Werror should be
> separate from the use of all the other -W* flags though: i.e. always
> show messages but only treat them as errors if we are running from HEAD.
Agreed.
> Aha. Actually, this should have worked on your side because the code
> is currently using -Wall first and later -Wno-unused-parameters to
> silence this part of -Wall. Might this be a bug in gcc 4.6?
Hmmm, I'm doubtful about it... I didn't heard about somebody "cleaning"
the option parser recently... Though I'm not following gcc-dev very
carefully, I admit.
> Could you paste a single gcc execution line from the build log to see
> in what order the -W flags are being passed to the compiler?
Here (after a 'make maintainer-clean && rm -f configure && autoreconf
-is && ./configure --enable-developer && make):
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
"-DATF_ARCH=\"unknown\"" "-DATF_BUILD_CC=\"gcc\""
"-DATF_BUILD_CFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wmissing-prototypes -Wno-traditional\"" "-DATF_BUILD_CPP=\"gcc -E\""
"-DATF_BUILD_CPPFLAGS=\"\"" "-DATF_BUILD_CXX=\"g++\""
"-DATF_BUILD_CXXFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wabi -Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend
-Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder
-Wsign-promo -Wsynth\"" "-DATF_CONFDIR=\"/usr/local/etc/atf\""
"-DATF_INCLUDEDIR=\"/usr/local/include\""
"-DATF_LIBDIR=\"/usr/local/lib\""
"-DATF_LIBEXECDIR=\"/usr/local/libexec\"" "-DATF_MACHINE=\"i686\""
"-DATF_M4=\"\"" "-DATF_PKGDATADIR=\"/usr/local/share/atf\""
"-DATF_SHELL=\"/bin/bash\"" "-DATF_WORKDIR=\"/tmp\"" -I./atf-c -g -O2
-Werror -g -Wall -Wcast-qual -Wextra -Wno-unused-parameter
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare
-Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional -MT atf-c/libatf_c_la-build.lo -MD -MP -MF
atf-c/.deps/libatf_c_la-build.Tpo -c -o atf-c/libatf_c_la-build.lo `test
-f 'atf-c/build.c' || echo './'`atf-c/build.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DATF_ARCH=\"unknown\"
-DATF_BUILD_CC=\"gcc\" "-DATF_BUILD_CFLAGS=\"-g -O2 -Werror -g -Wall
-Wcast-qual -Wextra -Wno-unused-parameter -Wpointer-arith
-Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wswitch
-Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional\"" "-DATF_BUILD_CPP=\"gcc -E\""
-DATF_BUILD_CPPFLAGS=\"\" -DATF_BUILD_CXX=\"g++\"
"-DATF_BUILD_CXXFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wabi -Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend
-Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder
-Wsign-promo -Wsynth\"" -DATF_CONFDIR=\"/usr/local/etc/atf\"
-DATF_INCLUDEDIR=\"/usr/local/include\" -DATF_LIBDIR=\"/usr/local/lib\"
-DATF_LIBEXECDIR=\"/usr/local/libexec\" -DATF_MACHINE=\"i686\"
-DATF_M4=\"\" -DATF_PKGDATADIR=\"/usr/local/share/atf\"
-DATF_SHELL=\"/bin/bash\" -DATF_WORKDIR=\"/tmp\" -I./atf-c -g -O2
-Werror -g -Wall -Wcast-qual -Wextra -Wno-unused-parameter
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare
-Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional -MT atf-c/libatf_c_la-build.lo -MD -MP -MF
atf-c/.deps/libatf_c_la-build.Tpo -c atf-c/build.c -o
atf-c/libatf_c_la-build.o
mv -f atf-c/.deps/libatf_c_la-build.Tpo atf-c/.deps/libatf_c_la-build.Plo
/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I.
"-DATF_ARCH=\"unknown\"" "-DATF_BUILD_CC=\"gcc\""
"-DATF_BUILD_CFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wmissing-prototypes -Wno-traditional\"" "-DATF_BUILD_CPP=\"gcc -E\""
"-DATF_BUILD_CPPFLAGS=\"\"" "-DATF_BUILD_CXX=\"g++\""
"-DATF_BUILD_CXXFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wabi -Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend
-Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder
-Wsign-promo -Wsynth\"" "-DATF_CONFDIR=\"/usr/local/etc/atf\""
"-DATF_INCLUDEDIR=\"/usr/local/include\""
"-DATF_LIBDIR=\"/usr/local/lib\""
"-DATF_LIBEXECDIR=\"/usr/local/libexec\"" "-DATF_MACHINE=\"i686\""
"-DATF_M4=\"\"" "-DATF_PKGDATADIR=\"/usr/local/share/atf\""
"-DATF_SHELL=\"/bin/bash\"" "-DATF_WORKDIR=\"/tmp\"" -I./atf-c -g -O2
-Werror -g -Wall -Wcast-qual -Wextra -Wno-unused-parameter
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare
-Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional -MT atf-c/libatf_c_la-check.lo -MD -MP -MF
atf-c/.deps/libatf_c_la-check.Tpo -c -o atf-c/libatf_c_la-check.lo `test
-f 'atf-c/check.c' || echo './'`atf-c/check.c
libtool: compile: gcc -DHAVE_CONFIG_H -I. -DATF_ARCH=\"unknown\"
-DATF_BUILD_CC=\"gcc\" "-DATF_BUILD_CFLAGS=\"-g -O2 -Werror -g -Wall
-Wcast-qual -Wextra -Wno-unused-parameter -Wpointer-arith
-Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare -Wswitch
-Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional\"" "-DATF_BUILD_CPP=\"gcc -E\""
-DATF_BUILD_CPPFLAGS=\"\" -DATF_BUILD_CXX=\"g++\"
"-DATF_BUILD_CXXFLAGS=\"-g -O2 -Werror -g -Wall -Wcast-qual -Wextra
-Wno-unused-parameter -Wpointer-arith -Wredundant-decls -Wreturn-type
-Wshadow -Wsign-compare -Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2
-Wabi -Wctor-dtor-privacy -Wno-deprecated -Wno-non-template-friend
-Wno-pmf-conversions -Wnon-virtual-dtor -Woverloaded-virtual -Wreorder
-Wsign-promo -Wsynth\"" -DATF_CONFDIR=\"/usr/local/etc/atf\"
-DATF_INCLUDEDIR=\"/usr/local/include\" -DATF_LIBDIR=\"/usr/local/lib\"
-DATF_LIBEXECDIR=\"/usr/local/libexec\" -DATF_MACHINE=\"i686\"
-DATF_M4=\"\" -DATF_PKGDATADIR=\"/usr/local/share/atf\"
-DATF_SHELL=\"/bin/bash\" -DATF_WORKDIR=\"/tmp\" -I./atf-c -g -O2
-Werror -g -Wall -Wcast-qual -Wextra -Wno-unused-parameter
-Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wsign-compare
-Wswitch -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wmissing-prototypes
-Wno-traditional -MT atf-c/libatf_c_la-check.lo -MD -MP -MF
atf-c/.deps/libatf_c_la-check.Tpo -c atf-c/check.c -o
atf-c/libatf_c_la-check.o
atf-c/check.c: In function 'atf_check_result_init':
atf-c/check.c:304:17: error: variable 'workdir' set but not used
[-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors
Regards
--
Emmanuel Fleury
Maître de conférence, | Bureau: 261
LaBRI, Domaine Universitaire | Tél: +33 (0)5 40 00 69 34
351, Cours de la Libération | Mél: emmanuel.fleury%labri.fr@localhost
33405 Talence Cedex, France | Web: http://www.labri.fr/~fleury
Home |
Main Index |
Thread Index |
Old Index