This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [patch] to bfd: K&R C fix
- To: binutils at sources dot redhat dot com
- Subject: Re: [patch] to bfd: K&R C fix
- From: msokolov at ivan dot Harhan dot ORG (Michael Sokolov)
- Date: Mon, 11 Sep 00 12:28:14 CDT
Nick Clifton <nickc@redhat.com> wrote:
> : 2000-09-10 Michael Sokolov <msokolov@ivan.Harhan.ORG>
> :
> : * elf.c (_bfd_elf_make_section_from_shdr): Make debug_sec_names static.
>
> Approved and applied.
Thanks.
Jeffrey A Law <law@cygnus.com> wrote:
> I'd prefer to keep it an auto variable and just initialize it in a K&R
> friendly way.
No, I think that making it static is definitely better, because it's much more
efficient for a constant array. Making it static means that both the strings
and the array of pointers to them will be completely build at compile time and
sit ready to use in the program image. Making it automatic means that each time
the code executes, it will have to allocate the array on the stack and fill it
in. This is a waste.
--
Michael Sokolov Harhan Engineering Laboratory
Public Service Agent International Free Computing Task Force
International Engineering and Science Task Force
615 N GOOD LATIMER EXPY STE #4
DALLAS TX 75204-5852 USA
Phone: +1-214-824-7693 (Harhan Eng Lab office)
E-mail: msokolov@ivan.Harhan.ORG (ARPA TCP/SMTP) (UUCP coming soon)