I updated a project recently (last I'd built it successfully was back in March) to the latest gcc and swig, and now my swig modules won't build (they use to build).
Rather than including my swig modules that won't build made a simple module example (attached) that demonstrates the problem.
$ swig -Wall -Werror -Wextra -includeall -small -c++ -lua -o foo_mod.c foo_mod.i
$ g++ -shared -o foo_mod.so foo_mod.c -rdynamic -fPIC -Wall -Werror -std=c++0x -O2 -fomit-frame-pointer
foo_mod.c: In function
foo_mod.c:1841:27: error: array subscript is above array bounds [-Werror=array-bounds]
foo_mod.c:1847:27: error: array subscript is above array bounds [-Werror=array-bounds]
cc1plus: all warnings being treated as errors
$ swig -version
SWIG Version 2.0.4
Compiled with g++ [x86_64-unknown-linux-gnu]
Configured options: +pcre
$ g++ --version
g++ (GCC) 4.6.1
I always use -Wall -Werror, and I don't want to disable -Werror=array-bounds for any part of my project.