[comp.sys.hp] Initialization bug in Series 800 C compiler?

bruce@bnr-vpa.UUCP (Bruce Townsend) (12/01/88)

I have run across what seems to be a bug in the HP-UX C compiler
for the Series 825 running version 2.0 of HP-UX.  It does not
accept very large initialized arrays:

static short big_array[] = {
 0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
    .
    . with more than 64K bytes data.
    .
 0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
}

If the above is compiled (cc -c filename.c), it silently generates
an object file that is very small (about 700 bytes).  If the data is
reduced to just below 64K bytes, it compiles correctly.

Is this a known bug?  Hopefully it will be fixed in upcoming releases.

Thanks for any info, etc...
-- 
Bruce Townsend (bnr-vpa!bruce)	Phone:	(613) 763-3008
Bell-Northern Research		Usenet: {utzoo, utcs}!bnr-vpa!bruce
P.O. Box 3511, Station C, Ottawa, Ontario, Canada, K1Y 4H7

corrigan@net1.ucsd.edu (Mike Corrigan) (12/02/88)

In article <105@bnr-vpa.UUCP> bruce@bnr-vpa.UUCP (Bruce Townsend) writes:
>I have run across what seems to be a bug in the HP-UX C compiler [2.0]
>static short big_array[] = {
>    . with more than 64K bytes data.
>}
>an object file that is very small (about 700 bytes).  If the data is
>reduced to just below 64K bytes, it compiles correctly.
>Is this a known bug?  Hopefully it will be fixed in upcoming releases.
>Bruce Townsend (bnr-vpa!bruce)	Phone:	(613) 763-3008
>Bell-Northern Research		Usenet: {utzoo, utcs}!bnr-vpa!bruce
>P.O. Box 3511, Station C, Ottawa, Ontario, Canada, K1Y 4H7

Doing this on HP-UX 2.1 -> same results => it still a bug in this release.
You may be able to edit the output of cc -S and add the missing
data back into the assembler code. The assembly is actually readable,
but there is a difference between running the sequence cc -c file.c->file.o
and cc -S file.c->file.S followed by cc -c file.S->file.o of an unknown (to me)
nature.

mike@pmafire.UUCP (mike caldwell) (12/02/88)

In article <105@bnr-vpa.UUCP> bruce@bnr-vpa.UUCP (Bruce Townsend) writes:
>I have run across what seems to be a bug in the HP-UX C compiler
>for the Series 825 running version 2.0 of HP-UX.  It does not
>accept very large initialized arrays:
>
>static short big_array[] = {
>    . with more than 64K bytes data.
>Is this a known bug?  Hopefully it will be fixed in upcoming releases.


We are using an Series 835 running version 2.1 of HP-UX.  We have some
X-window bitmaps that are larger than 100k of data in static short
arrays and compile without any problems.  There version of 2.1 that we
are running came with the 835 and I don't think it was an official
release, but I'm pretty sure that the official 2.1 has come since and
just hasn't been installed.  You might want to look into the
availability of 2.1 for the 825.

-- 
Mike Caldwell
Paths: ...uunet!bigtex!pmafire!mike | ...!ucdavis!egg-id!pma386!mike

shankar@hpclscu.HP.COM (Shankar Unni) (12/04/88)

> for the Series 825 running version 2.0 of HP-UX.  It does not
> accept very large initialized arrays:
> 
> static short big_array[] = {
>  0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
>     .
>     . with more than 64K bytes data.
>     .
>  0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,0xffff,
> }

This bug has been reported and attended to. A fix is available with HP-UX
v3.0.  The maximum *number* of initializers has been raised to about 64K.
---
Shankar Unni
HP/DLD/CLL.