Build error with gcc 4.3

Enric Balletbò i Serra eballetbo at gmail.com
Mon May 26 19:05:47 CEST 2008


Hi, first of all thanks for develop opkg, Building opkg from svn with
gcc 4.3.0 I get these warnings/errors:

Note  In gcc version 4.3.0 -Warray-bounds has been added and is now
enabled by default for -Wall . It produces warnings for array
subscripts that can be determined at compile time to be always out of
bounds. -Wno-array-bounds will disable the warning.

unarchive.c: In function 'extract_archive':
unarchive.c:87: warning: unused variable 'res'
unarchive.c:96: warning: array subscript is above array bounds
unarchive.c: In function 'deb_extract':
unarchive.c:764: warning: array subscript is above array bounds
unarchive.c:777: warning: array subscript is above array bounds

copy_file.c: In function 'copy_file':
copy_file.c:110: warning: array subscript is above array bounds

cc1: warnings being treated as errors
opkg_cmd.c: In function 'opkg_flag_cmd':
opkg_cmd.c:978: error: array subscript is above array bounds
make[2]: *** [libopkg_la-opkg_cmd.lo] Error 1
make[2]: Leaving directory `/home/jdoe/workspaceopkg-0.0+svn/opkg/libopkg'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/jdoe/workspace/opkg-0.0+svnr/opkg/libopkg'
make: *** [all-recursive] Error 1

At the moment I solved this problem with these provisional patches:

--- start patch ---
--- libopkg/Makefile.in.orig    2008-05-26 18:23:52.000000000 +0200
+++ libopkg/Makefile.in 2008-05-26 18:26:27.000000000 +0200
@@ -215,7 +215,7 @@
 target_alias = @target_alias@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-ALL_CFLAGS = -g -O -Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\"
-DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\"
-DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir)
+ALL_CFLAGS = -g -O -Wall -Werror -Wno-array-bounds
-DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@
-DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\"
-DDATADIR=\"@datadir@\" -I$(top_srcdir)
 libopkg_includedir = $(includedir)/libopkg
 libopkg_include_HEADERS = \
        args.h \
--- end ---

--- start patch ---
--- libopkg/Makefile.am.orig    2008-05-26 18:29:31.000000000 +0200
+++ libopkg/Makefile.am 2008-05-26 18:30:13.000000000 +0200
@@ -1,5 +1,5 @@

-ALL_CFLAGS=-g -O -Wall -Werror -DHOST_CPU_STR=\"@host_cpu@\"
-DBUILD_CPU=@build_cpu@ -DLIBDIR=\"@libdir@\"
-DOPKGLIBDIR=\"@opkglibdir@\" -DDATADIR=\"@datadir@\" -I$(top_srcdir)
+ALL_CFLAGS=-g -O -Wall -Werror -Wno-array-bounds
-DHOST_CPU_STR=\"@host_cpu@\" -DBUILD_CPU=@build_cpu@
-DLIBDIR=\"@libdir@\" -DOPKGLIBDIR=\"@opkglibdir@\"
-DDATADIR=\"@datadir@\" -I$(top_srcdir)

 libopkg_includedir=$(includedir)/libopkg
--- end ---

Regards,

-- 
Enric Balletbò i Serra


More information about the opkg-devel mailing list