[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libposix stuff
From: |
Ralf Wildenhues |
Subject: |
Re: libposix stuff |
Date: |
Mon, 8 Nov 2010 22:29:28 +0100 |
User-agent: |
Mutt/1.5.20 (2010-08-04) |
Hello,
* Bruce Korb wrote on Mon, Nov 08, 2010 at 05:29:57PM CET:
> On 11/07/10 12:40, Bruno Haible wrote:
> >> -extern char *program_name;
> >> +char *program_name;
> >> ...
> >> + char const *p = program_name ? program_name : "unknown";
> >
> > No, this is not OK, for two reasons:
> > 1) It will cause a link error for all programs that define the
> > 'program_name'
> > variable, on all non-ELF platforms (mainly MacOS X and Woe32).
>
> I remember back in the mid-70's writing C code that used that
> very technique for declaring external variables. "a.out" format:
> char *program_name;
> this on a line by itself was both a declaration and a definition.
> It strikes me as quite odd that new formats would come along and
> require the "extern" keyword to make it a non-definition. I believe
> you, but still quite odd.
On OS X that may just be the case because libtool forces -fno-common
(for some good reason, but I tend to forget what it was), which disables
common sections.
Cheers,
Ralf
- error.c has an unnecessary dependency on "program_name", Bruce Korb, 2010/11/07
- Re: error.c has an unnecessary dependency on "program_name", Bruno Haible, 2010/11/07
- Re: libposix stuff, Bruce Korb, 2010/11/08
- Re: libposix stuff, Gary V. Vaughan, 2010/11/08
- Re: libposix stuff,
Ralf Wildenhues <=
- Re: libposix stuff, Bruce Korb, 2010/11/08
- Re: libposix stuff, Eric Blake, 2010/11/08
- Re: libposix stuff, Bruce Korb, 2010/11/08
- Re: libposix stuff, Thien-Thi Nguyen, 2010/11/09
- Re: libposix stuff, Bastien ROUCARIES, 2010/11/09
- Re: libposix stuff, Bastien ROUCARIES, 2010/11/15
- Re: libposix stuff, Bastien ROUCARIES, 2010/11/22