When building binutils-2.18 with HP AnsiC compiler, which does not build C99 by default, besides many warnings there is one error: /source/binutils-2.18/bfd/elflink.c", line 7378: error #2028: expression must have a constant value char symbuf [bufsz]; Using an enum for bufsz instead of const int will work here: --- binutils-2.18/bfd/elflink.c.orig 2007-10-10 21:23:09.148839000 +0200 +++ binutils-2.18/bfd/elflink.c 2007-10-10 21:23:59.117386000 +0200 @@ -7374,7 +7374,7 @@ int symlen; bfd_vma a; bfd_vma b; - const int bufsz = 4096; + enum { bufsz = 4096 }; char symbuf [bufsz]; const char * symend; bfd_boolean symbol_is_section = FALSE;
Created attachment 2040 [details] Remove use of bufsz variable from eval_symbol()
Hi Michael, Actually there is no need for the bufsz variable at all. It is cleaner just to give the symbuf array a constant size and then refer to 'sizeof (symbuf)' in the code. So that is what the uploaded patch does, and this is what I will be checking in. Cheers Nick bfd/ChangeLog 2007-10-12 Nick Clifton <nickc@redhat.com> PR 5160 * elflink.c (eval_symbol): Remove bufsz variable and use sizeof(symbuf) where necessary.