This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Re: coffcode.h uses non-ISO-C: int a[f()];
- To: ac131313 at cygnus dot com
- Subject: Re: coffcode.h uses non-ISO-C: int a[f()];
- From: Ian Lance Taylor <ian at zembu dot com>
- Date: 15 Feb 2000 11:20:07 -0500
- CC: binutils at sourceware dot cygnus dot com
- References: <38A90C13.3E1D1BB7@cygnus.com>
Date: Tue, 15 Feb 2000 19:19:31 +1100
From: Andrew Cagney <ac131313@cygnus.com>
diff -p -r1.29 coffcode.h
*** coffcode.h 2000/02/10 21:21:55 1.29
--- coffcode.h 2000/02/15 08:10:45
*************** coff_set_arch_mach_hook (abfd, filehdr)
*** 1880,1886 ****
cputype = 0;
else
{
! bfd_byte buf[bfd_coff_symesz (abfd)];
struct internal_syment sym;
if (bfd_seek (abfd, obj_sym_filepos (abfd), SEEK_SET) !=
0
which stops it being compiled by AIX's native compiler - a constant is
needed.
Roughtly, what is the correct way if fixing this? alloca() or
bfd_malloc() / bfd_free()?
bfd_malloc()/free(). BFD doesn't use alloca, because on a few systems
this causes the C version of alloca to be used, which causes the
program to crash when it runs out of memory.
I wonder if we could define some constant for the maximum value of
SYMESZ? It's kind of dumb to do this and other memory allocations
solely for the benefit of one rather obscure target.
Ian