Bug 2280

Summary: Build fails during frysk-core
Product: frysk Reporter: Adam Jocksch <ajocksch>
Component: generalAssignee: Adam Jocksch <ajocksch>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: unspecified   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Bug Depends on:    
Bug Blocks: 2235, 2104    

Description Adam Jocksch 2006-02-06 18:41:16 UTC
The build fails on FC5 with the follwing message:
cc1: warnings being treated as errors
frysk/pkglibexecdir/funit-modify.c: In function 'main':
frysk/pkglibexecdir/funit-modify.c:87: warning: ignoring return value of
'fwrite', declared with attribute warn_unused_result
make[3]: *** [frysk/pkglibexecdir/funit-modify.o] Error 1

gcc (GCC) 4.1.0 20060131 (Red Hat 4.1.0-0.20)
Comment 1 Adam Jocksch 2006-02-06 18:42:56 UTC
Correction, this only happens when running make i386 when building an rpm
locally. Frysk builds fine out of cvs.
Comment 2 Andrew Cagney 2006-02-06 19:21:24 UTC
The original GCC line, and not just the output would be useful here.

rpm builds things with more, and more pedantic, flags.  Likely one of them is
enabling the warning and that in turn causing a fail.

Examine the CC line and see if anything obvious is different (likely either
-D_... or -W...).  Any way the warning can be fixed.
Comment 3 Adam Jocksch 2006-02-06 19:48:10 UTC
This is the command executed by rpmbuild:
if /usr/bin/gcc -DPACKAGE_NAME=\"frysk\" -DPACKAGE_TARNAME=\"frysk\"
-DPACKAGE_VERSION=\"0.0.1.2006.02.06\" -DPACKAGE_STRING=\"frysk\
0.0.1.2006.02.06\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"frysk\"
-DVERSION=\"0.0.1.2006.02.06\"  -I. -I.  -I. -I. -Werror -Wall -fPIC  -O2 -g
-pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=pentium4
-fasynchronous-unwind-tables -MT frysk/pkglibexecdir/funit-print-argc.o -MD -MP
-MF "$depbase.Tpo" -c -o frysk/pkglibexecdir/funit-print-argc.o
frysk/pkglibexecdir/funit-print-argc.c;

And this is from cvs:
if gcc -DPACKAGE_NAME=\"frysk\" -DPACKAGE_TARNAME=\"frysk\"
-DPACKAGE_VERSION=\"0.0.1.2006.02.06\" -DPACKAGE_STRING=\"frysk\
0.0.1.2006.02.06\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"frysk\"
-DVERSION=\"0.0.1.2006.02.06\"  -I. -I/home/ajocksch/src/frysk/frysk-core   
-I/home/ajocksch/src/frysk/frysk-core -I. -Werror -Wall -fPIC  -g -O -MT
frysk/pkglibexecdir/funit-print-argc.o -MD -MP -MF "$depbase.Tpo" -c -o
frysk/pkglibexecdir/funit-print-argc.o
/home/ajocksch/src/frysk/frysk-core/frysk/pkglibexecdir/funit-print-argc.c;

It seems the extra parameters are
-pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=pentium4
Comment 4 Adam Jocksch 2006-02-06 22:22:08 UTC
Tried building frysk from cvs with {CFLAGS,GCJFLAGS} set to:
 -Werror -Wall -fPIC  -O2 -pipe -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=pentium4 -MT -MD -MP -MF

Was unable to reproduce the error. Adding -Wp,-D_FORTIFY_SOURCE=2 breaks the
build as in trying to build the rpm
Comment 5 Adam Jocksch 2006-02-08 20:52:27 UTC
2006-02-08  Adam Jocksch  <ajocksch@toothpaste.toronto.redhat.com>

        * funit-syscallint.c (main): Fix compiler warnings.
        * funit-modify.c (main): Now checks return value of fwrite, aborts
        if it is != 1.

Closing bug.