[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: remove unportable casts and storage allocation tricks from Bison
From: |
Paul Eggert |
Subject: |
Re: remove unportable casts and storage allocation tricks from Bison |
Date: |
Thu, 9 Jan 2003 21:16:42 -0800 (PST) |
> From: Akim Demaille <address@hidden>
> Date: Thu, 09 Jan 2003 10:12:47 +0100
>
> Paul> Some architectures don't let you compute pointers to places that
> Paul> aren't really storage.
>
> I've heard that too, but saw no evidence of this either.
I tracked down one example of an architecture that has the problem:
the 80386 (and later) in 32-bit mode if the large array is allocated
in a separate segment. In this case the nonconforming pointer
arithmetic can change the segment number causing a segment fault, even
if the resulting pointer is not dereferenced. The x86 architecture is
still fairly popular, so this is of some practical concern.
> Huh. Now I think I see what you mean: padding *after* the array
> (pointer) in the struct?
Yes, that's it.