Re: Solaris getopt_long and PostgreSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Solaris getopt_long and PostgreSQL
Date
Msg-id 18115.1238516512@sss.pgh.pa.us
Whole thread Raw
In response to Re: Solaris getopt_long and PostgreSQL  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
Responses Re: Solaris getopt_long and PostgreSQL  (Zdenek Kotala <Zdenek.Kotala@Sun.COM>)
List pgsql-hackers
Zdenek Kotala <Zdenek.Kotala@Sun.COM> writes:
> Yeah correct, I overlooked that optreset is also defined as a extern. 
> There is updated patch.

On looking at this I still can't see how it's not broken.  You are
effectively assuming that getopt_long.c must define those variables.
But surely getopt_long.c should be assuming that getopt.c defines them.
Aren't we likely to end up with the situation that everyone is
extern'ing them?

What appears to me to be happening is that Solaris' linker is failing to
merge global variable definitions when it should (must) do so.  We need
to find out why rather than solve it with a patch that will certainly
break other platforms.

If you can't come up with a real solution, we might have to do this
with "#ifndef SOLARIS" or something similar.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Greg Stark
Date:
Subject: Re: string_to_array with empty input
Next
From: justin
Date:
Subject: Re: [GENERAL] string_to_array with empty input