Modify

Opened 6 years ago

Closed 6 years ago

Last modified 4 years ago

#10962 closed defect (fixed)

Compiling collectd fails with new gcc 4.6: variable 'len' set but not used [-Werror=unused-but-set-variable] cc1: all warnings being treated as errors

Reported by: hnyman Owned by: developers
Priority: normal Milestone: Barrier Breaker 14.07
Component: packages Version: Trunk
Keywords: collectd gcc Cc: hannu.nyman@…

Description

After the compiler got bumped up to gcc 4.6 today, compiling collectd fails.

Probably due to too tight error/warning checking:

libiptc.c:1195:9: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

Full log extract

make[3]: Entering directory `/Openwrt/trunk/feeds/packages/utils/collectd'
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float  -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float  -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/include " LDFLAGS="-L/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/usr/lib -L/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/lib -L/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr/lib -L/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/lib " make  -j1 -C /Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[4]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2'
Making all in libltdl
make[5]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/libltdl'
make  all-am
make[6]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/libltdl'
make[6]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/libltdl'
make[5]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/libltdl'
Making all in src
make[5]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src'
make  all-recursive
make[6]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src'
Making all in libcollectdclient
make[7]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/libcollectdclient'
make  all-am
make[8]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/libcollectdclient'
make[8]: Nothing to be done for `all-am'.
make[8]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/libcollectdclient'
make[7]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/libcollectdclient'
Making all in owniptc
make[7]: Entering directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/owniptc'
/bin/bash ../../libtool --tag=CC   --mode=compile mips-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I../../src   -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/include  -Wall -Werror -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float  -fpic -c -o libip4tc.lo libip4tc.c
OpenWrt-libtool: compile:  mips-openwrt-linux-uclibc-gcc -DHAVE_CONFIG_H -I. -I../../src -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/usr/include -I/Openwrt/trunk/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33/include -Wall -Werror -Os -pipe -mips32r2 -mtune=mips32r2 -fno-caller-saves -fhonour-copts -msoft-float -fpic -c libip4tc.c  -fPIC -DPIC -o .libs/libip4tc.o
In file included from libip4tc.c:136:0:
libiptc.c: In function 'iptcc_chain_index_delete_chain':
libiptc.c:552:32: error: variable 'index_ptr2' set but not used [-Werror=unused-but-set-variable]
libiptc.c: In function 'alloc_handle':
libiptc.c:1195:9: error: variable 'len' set but not used [-Werror=unused-but-set-variable]
cc1: all warnings being treated as errors

make[7]: *** [libip4tc.lo] Error 1
make[7]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/owniptc'
make[6]: *** [all-recursive] Error 1
make[6]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src'
make[5]: *** [all] Error 2
make[5]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2'
make[3]: *** [/Openwrt/trunk/build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/.built] Error 2
make[3]: Leaving directory `/Openwrt/trunk/feeds/packages/utils/collectd'
make[2]: *** [package/feeds/packages/collectd/compile] Error 2
make[2]: Leaving directory `/Openwrt/trunk'
make[1]: *** [/Openwrt/trunk/staging_dir/target-mips_r2_uClibc-0.9.33/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Openwrt/trunk'
make: *** [world] Error 2

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by hnyman <hannu.nyman@…>

Still there with 30523.

Collectd includes 'owniptc' directory in its source files, and the Makefile.am of that module contains:

if COMPILER_IS_GCC
AM_CFLAGS = -Wall -Werror
endif

I removed the -Werror option, and compilation works again:

if COMPILER_IS_GCC
AM_CFLAGS = -Wall
endif

Hopefully somebody can turn this to a proper patch. File location is /build_dir/target-mips_r2_uClibc-0.9.33/collectd-4.10.2/src/owniptc/Makefile.am

comment:2 Changed 6 years ago by jow

  • Resolution set to fixed
  • Status changed from new to closed

Fixed with r30533

comment:3 Changed 6 years ago by hnyman <hannu.nyman@…>

Just out of curiosity I looked for collectd source:

Those two surplus variables about which gcc4.6 complained, have been removed in August 2011 from collectd source code.

"Many build fixes that turned up with GCC 4.6." http://git.verplant.org/?p=collectd.git;a=commit;h=61a1fa91ba73e4fe3a34949f77c5f017056f2b7a

The fixes would be included the current collectd 4.10.5 (or in 4.10.4), but because we are still using the old 4.10.2, gcc ran into that problem already fixed in upstream. Hopefully somebody has the energy to bump the version of that package.


comment:4 Changed 4 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

Add Comment

Modify Ticket

Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.