Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
build error in nrv2b.c on Ubuntu 11.10 32bits
2012-04-19, 01:35
Post: #1
build error on Ubuntu 11.10 32bits
Hello -


git cloned today ( git clone git://git.ipxe.org/ipxe.git )

and immediately ran make

The first "make" command failed with this error:

ar: creating bin/blib.a
[HOSTCC] util/zbin
In file included from util/zbin.c:6:0:
util/nrv2b.c: In function ‘find_match’:
util/nrv2b.c:633:17: error: array subscript is above array bounds [-Werror=array-bounds]
util/nrv2b.c:634:14: error: array subscript is above array bounds [-Werror=array-bounds]
cc1: all warnings being treated as errors

make: *** [util/zbin] Error 1


I am using a Ubuntu 11.10 (upgraded from 10.10, upgraded from 10.04) x86 environment in a VMWare guest (but I don't think this is important).
All updates applied. I undertsand what the error mean and that I could even get rid of it by making the build environment considering it a non-stopping warning, but this is not clean and is certainly not expected.

Thanks in advance for your help
Find all posts by this user
Quote this message in a reply
2012-04-20, 18:59
Post: #2
build error in nrv2b.c on Ubuntu 11.10 32bits
Hello


Fresh git clone of ipxe code, tried to build on Ubuntu 11.10 (all updates applied), I get this error:

[AR] bin/blib.a
ar: creating bin/blib.a
[HOSTCC] util/zbin
In file included from util/zbin.c:6:0:
util/nrv2b.c: In function ‘find_match’:
util/nrv2b.c:633:17: error: array subscript is above array bounds [-Werror=array-bounds]
util/nrv2b.c:634:14: error: array subscript is above array bounds [-Werror=array-bounds]
cc1: all warnings being treated as errors

make: *** [util/zbin] Error 1
user@Ubuntu-VM1:~/iPXE/ipxe/src$


Any idea how to solve it?
Find all posts by this user
Quote this message in a reply
2012-04-21, 07:52
Post: #3
RE: build error in nrv2b.c on Ubuntu 11.10 32bits
That one has been puzzling the development team for a short while.

You can work around it by adding a NO_WERROR=1 to your make command line, as mentioned on the mailing list
Visit this user's website Find all posts by this user
Quote this message in a reply
2012-07-02, 17:45
Post: #4
RE: build error in nrv2b.c on Ubuntu 11.10 32bits
The same error to me.
util/nrv2b.c like this
Code:
...
#define SWD_BEST_OFF    1
...

struct ucl_swd
{
...
#if defined(SWD_BEST_OFF)
        unsigned int best_pos[ SWD_BEST_OFF ];
#endif
...
}

...
#if defined(SWD_BEST_OFF)
        if (s->best_pos[2] == 0)  /*line 633*/
                s->best_pos[2] = key + 1;  /*line 634*/
#endif
...

I insert one line before line 633, like this
Code:
#if defined(SWD_BEST_OFF)
    if(sizeof(s->best_pos)/sizeof(s->best_pos[0])>2)
        if (s->best_pos[2] == 0)  /*line 633*/
                s->best_pos[2] = key + 1;  /*line 634*/
#endif
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)