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

Reply via email to