[Libwebsockets] Configure error

Jack Mitchell ml at communistcode.co.uk
Tue Jan 15 15:24:33 CET 2013

On 15/01/13 14:21, "Andy Green (林安廸)" wrote:
> On 15/01/13 22:08, the mail apparently from Jack Mitchell included:
> Wow...
>> test-server.c: In function ‘callback_http’:
>> test-server.c:243:50: error: array subscript is above array bounds
>> [-Werror=array-bounds]
>> test-server.c:244:47: error: array subscript is above array bounds
>> [-Werror=array-bounds]
> huh... that's
>     pollfd_maps[hash][n].index = 
> pollfd_maps[hash][pollfd_count[hash]].index;
>     pollfd_maps[hash][n].fd = pollfd_maps[hash][pollfd_count[hash]].fd;
> all of the array indexes are variables...
> For the compiler to think it could say there was a problem either hash 
> or n would have to have been resolved to be (a big) constant.
> I'm not really seeing how that can be legit when it compiles here on 
> gcc 4.7.2 with pedantic and Wall Werror (and works then).
> Is the compiler a bit new or anything?
> -Andy

[jack at archHP ~]$ gcc -v
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /build/src/gcc-4.7.2/configure --prefix=/usr 
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man 
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ 
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared 
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit 
--disable-libunwind-exceptions --enable-clocale=gnu 
--disable-libstdcxx-pch --enable-libstdcxx-time 
--enable-gnu-unique-object --enable-linker-build-id --with-ppl 
--enable-cloog-backend=isl --disable-ppl-version-check 
--disable-cloog-version-check --enable-lto --enable-gold 
--enable-ld=default --enable-plugin --with-plugin-ld=ld.gold 
--with-linker-hash-style=gnu --disable-multilib --disable-libssp 
--disable-build-with-cxx --disable-build-poststage1-with-cxx 
Thread model: posix
gcc version 4.7.2 (GCC)

I can say that it builds fine in my cross compile environment which is 
also GCC 4.7.2 but it is a completely different tool chain to my x86_64 box.


   Jack Mitchell (jack at embed.me.uk)
   Embedded Systems Engineer


More information about the Libwebsockets mailing list