[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: extensions module and Solaris
From: |
Eric Blake |
Subject: |
Re: extensions module and Solaris |
Date: |
Tue, 27 May 2008 17:56:09 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Eric Blake <ebb9 <at> byu.net> writes:
> But in my (limited) testing, I wasn't able to get that to
> happen with either gcc 3.3 or /usr/ucb/cc as the compiler and -
D_POSIX_SOURCE=1
> on the command line. Any ideas on how to select the standards-compliant
system
> (2) implementation on Solaris?
After reading 'man standards' again, I figured out that this works to expose
the difference in implementation (using the particular system call that tripped
up the M4 testsuite):
$ cat foo.c
#include <stdlib.h>
#include <sys/wait.h>
int main()
{
exit (WEXITSTATUS (system ("echo hi >&3")));
}
$ gcc -o foo -Wall foo.c
$ ./foo
hi
$ gcc -o foo -Wall foo.c /usr/ccs/lib/values-xpg4.o
$ ./foo
sh: 3: bad file unit number
$ nm /usr/ccs/lib/values-xpg4.o
00000000 D __xpg4
So maybe the question is better worded:
Should we figure out a way to make inclusion of the extensions module cause
compilation on Solaris to favor the standards-compliant behavior of various
functions? Should we try to directly add values-xpg4.o to the link line, or
are we better off providing a .c file which provides the same definition of
__xpg4 as what values-xpg4.o provides?
--
Eric Blake