#2154 OpenBSD: "array size (14) smaller than bound length (18)"

closed-out-of-date
None
Build
5
2015-01-12
2013-04-18
No

I'm trying to update OpenBSD's sdcc package from 2.8.0 to 3.2.0. Attached is a patch against OpenBSD's ports tree for reference--to use it on an OpenBSD -current system with ports tree in /usr/ports, run "cd /usr/ports/devel/sdcc && patch < sdcc.diff && make build".

The build fails here:

libtool: compile:  cc -DHAVE_CONFIG_H -I. -DNETBSD_CORE -I. -I. -I./../include -DHAVE_bfd_elf64_x86_64_vec -DHAVE_bfd_elf32_i386_vec -DHAVE_i386netbsd_vec -DHAVE_i386coff_vec -DHAVE_i386pei_vec -DHAVE_x86_64pei_vec -DHAVE_bfd_elf64_l1om_vec -DHAVE_bfd_elf64_k1om_vec -DHAVE_bfd_elf64_little_generic_vec -DHAVE_bfd_elf64_big_generic_vec -DHAVE_bfd_elf32_little_generic_vec -DHAVE_bfd_elf32_big_generic_vec -DBINDIR=\"/usr/local/bin\" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -O2 -pipe -g -MT peigen.lo -MD -MP -MF .deps/peigen.Tpo -c peigen.c -o peigen.o
cc1: warnings being treated as errors
peigen.c: In function '_bfd_pei_swap_aux_in':
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c:252: warning: array size (14) smaller than bound length (18)
peigen.c: In function '_bfd_pei_swap_aux_out':
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
peigen.c:326: warning: array size (14) smaller than bound length (18)
gmake[5]: *** [peigen.lo] Error 1
1 Attachments

Discussion

  • Anthony J. Bentley

    Using gcc version 4.2.1, the system default.

     
  • Borut Ražem

    Borut Ražem - 2013-04-18

    Hi Anthony,

    sdcc developers do not maintain the OpenBSD sdcc port. You should send this patch to OpenBSD sdcc port maintainers.

    But I did an other thing: in svn revision #8525 I replaced all remaining #!/bin/bash with #!/bin/sh, so the sdcc build should not depend on bash any more.

    Borut

     
  • Borut Ražem

    Borut Ražem - 2013-04-18
    • status: open --> closed
    • assigned_to: Borut Ražem
     
  • Anthony J. Bentley

    Thanks for the reply, Borut.

    In fact, I am an OpenBSD packager. The diff was just for reference, in case someone wanted to reproduce my build. The real reason for this bug report is the compile error mentioned above. This is a bug in sdcc (since sdcc explicitly enables -Werror in builds, the code should compile with no warnings). Please reopen this bug.

     
  • Borut Ražem

    Borut Ražem - 2013-04-18

    I reopened the bug.
    Sorry for my misunderstanding!

    Borut

     
  • Borut Ražem

    Borut Ražem - 2013-04-18
    • status: closed --> open
     
  • Borut Ražem

    Borut Ražem - 2013-04-19

    I don't know whether this is a compiler or binutils problem: we are compiling binutils on several platforms/compilers (see sdcc snapshot builds), but none of them has this problem...

    SDCC 3.2.0 sdbinutils is actually stripped down binutils 2.22, so if it turns out that this is rally a binutils problem, it should be reported to binutils developers.

    To work around the sdcc problem I suggest the following:
    Try to compile sdbinutils without -Werror flag so that warnings will not be treated as errors. This might also be the final solution unless you try to replace the sdcc 3.2.0 support/sdbinutils directory with one from SDCC svn HEAD. This one is updated to binutils 2.23 and all unnecessary modules are excluded, including the offending peigen.c (actually peXXigen.c). So it might happen that it compiles without errors even with the -Werror flag.

    Borut

     
  • Maarten Brock

    Maarten Brock - 2013-12-19

    Hello Anthony,

    Without asking you to create and distribute a package from our svn HEAD, can you please try to reproduce the problem with the HEAD? If it is fixed can you please report that back so we can close this one before any new release?

    Maarten

     
  • Philipp Klaus Krause

    • status: open --> closed-out-of-date
     
  • Philipp Klaus Krause

    I have not seen such problems when compiling current svn on OpenBSD 5.5.

    Philipp

     

Log in to post a comment.