public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* is 980223.c wrong?
@ 2001-09-14 11:44 Aldy Hernandez
  2001-09-14 14:31 ` Richard Henderson
  0 siblings, 1 reply; 2+ messages in thread
From: Aldy Hernandez @ 2001-09-14 11:44 UTC (permalink / raw)
  To: gcc

i'm having doubts about 980223.c:
    
    int nil;
    object cons1[2] = { {(long) &nil, 0}, {(long) &nil, 0} };
    object cons2[2] = { {(long) &cons1, 64}, {(long) &nil, 0} };
    
if sizeof(long) != sizeof(int *), the initializer is not a constant and
gcc barfs.  

particularly this gives problem with mips when longs are 64bits and GP
registers (and consecuently pointers) are 32bits.
    
-- 
Aldy Hernandez					E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: is 980223.c wrong?
  2001-09-14 11:44 is 980223.c wrong? Aldy Hernandez
@ 2001-09-14 14:31 ` Richard Henderson
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Henderson @ 2001-09-14 14:31 UTC (permalink / raw)
  To: Aldy Hernandez; +Cc: gcc

On Fri, Sep 14, 2001 at 02:47:01PM -0400, Aldy Hernandez wrote:
> i'm having doubts about 980223.c:
>     
>     int nil;
>     object cons1[2] = { {(long) &nil, 0}, {(long) &nil, 0} };
>     object cons2[2] = { {(long) &cons1, 64}, {(long) &nil, 0} };
>     
> if sizeof(long) != sizeof(int *), the initializer is not a constant and
> gcc barfs.  

Yes, that's wrong.  I can't find where this bug was first reported,
so I can't determine what the original bug was (other than it came
from emacs of course).  

I suspect that you can change the "long" object member to "char*"
without affecting the test case overmuch.  Plus it'll now work for
your odd mips combinations.


r~

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-09-14 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-14 11:44 is 980223.c wrong? Aldy Hernandez
2001-09-14 14:31 ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).