sparc/4.0 compiler weirdness?
Ed Arnold
era at bierstadt.ucar.edu
Thu Jun 8 07:28:33 AEST 1989
Can someone out there tell me if there's some logic behind the following
behavior of the SunOS 4.0 C compiler for sparc machines, or is this a bug?
This behavior is of interest because it breaks certain applications; e.g.,
nroff driver tables can't be compiled on the server.
The scenario is a 4/280 running 4.0, supporting a bunch of sun-3 clients,
also running 4.0. The behavior of interest can be observed by compiling
the following line of C:
struct { char *p; } s = {"Goodbye, World.\n"};
When this is compiled on any of the sun-3 clients, the first 64 bytes of
the resulting .o file are as expected (note that "p" has been set to octal
10, i.e. where the string begins relative to location 040):
0000000 000002 000407 000000 000000 000000 000040 000000 000000
0000020 000000 000014 000000 000000 000000 000000 000000 000010
0000040 000000 000010 000000 000000 043557 067544 061171 062454
0000060 020127 067562 066144 027012 000000 000000 000000 000000
However, when it's compiled on the sun-4 server, the first 64 bytes of the
resulting .o file are as follows (note that "p" has been assigned a value
of zero):
0000000 000403 000407 000000 000000 000000 000040 000000 000000
0000020 000000 000014 000000 000000 000000 000000 000000 000014
0000040 000000 000000 000000 000000 043557 067544 061171 062454
0000060 020127 067562 066144 027012 000000 000000 000000 000000
Ed Arnold
era at ncar.ucar.edu
More information about the Comp.sys.sun
mailing list