Menu

#15 make fails with CFLAGS=-Wall -Werror/parse.c & sudosh.c

v1.0_(example)
closed-fixed
nobody
None
5
2014-08-14
2010-10-21
Anonymous
No

I'm attempting to build sudosh2 as an rpm via rpmbuild on CentOS 5.5. rpmbuild adds -Wall on this platform. When not configuring/building with rpmbuild, sudosh2 build just fine(because it doesn't treat warnings as errors). I've further pinpointed -Wall being the issue(and not some other CFLAGS rpmbuild adds) by adding -Wall to src/Makefile before make'ing on a standard 'configure, make' cycle.

make output:

+ /usr/bin/make -j3
/usr/bin/make all-recursive
make[1]: Entering directory `/mnt/cri-rpm/rpmbuild/BUILD/sudosh2-1.0.4'
Making all in src
make[2]: Entering directory `/mnt/cri-rpm/rpmbuild/BUILD/sudosh2-1.0.4/src'
gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror -MT sudosh.o -MD -MP -MF .deps/sudosh.Tpo -c -o sudosh.o sudosh.c
gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror -MT rand.o -MD -MP -MF .deps/rand.Tpo -c -o rand.o rand.c
gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror -MT parse.o -MD -MP -MF .deps/parse.Tpo -c -o parse.o parse.c
cc1: warnings being treated as errors
parse.c: In function 'parse':
parse.c:20: warning: unused variable 'y'
parse.c:14: warning: unused variable 'opt'
parse.c:14: warning: unused variable 'cmt'
parse.c:14: warning: unused variable 'arg'
parse.c:10: warning: unused variable 'i'
parse.c:10: warning: unused variable 'line_number'
cc1: warnings being treated as errors
sudosh.c: In function 'main':
sudosh.c:486: warning: unused variable 'written'
sudosh.c:112: warning: unused variable 'found'
mv -f .deps/rand.Tpo .deps/rand.Po
make[2]: *** [parse.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [sudosh.o] Error 1
make[2]: Leaving directory `/mnt/cri-rpm/rpmbuild/BUILD/sudosh2-1.0.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/cri-rpm/rpmbuild/BUILD/sudosh2-1.0.4'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.27845 (%build)

Discussion

  • Anonymous

    Anonymous - 2010-10-21

    Of course I can build without -Wall, as the unused vars are probably low risk. It just breaks consistency on this platform. But I noticed a changelog entry from 2005 that sudosh2 was made to build with -Wall.

     
  • Anonymous

    Anonymous - 2011-09-15

    I agree that sudosh.c cannot build using `-Wall`. I am compiling on a new SL6.1 (RHEL 6.1 clone) host, and get the following error:

    # gcc -DHAVE_CONFIG_H -I. -I.. -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Werror -MT sudosh.o -MD -MP -MF .deps/sudosh.Tpo -c -o sudosh.o.bad sudosh.c
    cc1: warnings being treated as errors
    sudosh.c: In function ‘main’:
    sudosh.c:183: error: the address of ‘c_str’ will always evaluate as ‘true’
    sudosh.c:486: error: unused variable ‘written’
    sudosh.c:112: error: unused variable ‘found’

    # uname -a
    Linux localhost.localdomain 2.6.32-131.0.15.el6.x86_64 #1 SMP Sat May 21 10:27:57 CDT 2011 x86_64 x86_64 x86_64 GNU

     
  • Josh Grebe

    Josh Grebe - 2014-01-22

    These should all be corrected in the 1.0.5 release.

     
  • Josh Grebe

    Josh Grebe - 2014-01-22
    • status: open --> closed-fixed
    • Group: --> v1.0_(example)
     

Log in to post a comment.