> On Mon, Sep 7, 2009 at 7:07 PM, Peter Pentchev<[email protected]> wrote: > > On Mon, Sep 07, 2009 at 06:03:55PM +0200, Frans Pop wrote: > >> Carlos O'Donell wrote: > >> > I'm a debian-hppa porter, do you have a test case along with a clear > >> > description of the problem? > > > > Well, the "real" test case is fetching and trying to build > > gforth-0.7.0+ds1-4 as available in sid. =A0I'm pretty sure I could isolat= > e > > it to a smaller test case with access to an hppa machine; see below :) > > Be assured that gforth is 11th on my task list of things to accomplish > as a debian-hppa porter. So it will be a while before I can get there, > but I will get there (unless gmail looses my debian-hppa porter task > list). I have an sbuild setup on my hppa machine, I will try to build > gforth and see what happens. > > > =A0 typedef char * ac__type_sizeof_; > > int > > main () > > { > > static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_)))= > <=3D $ac_mid)]; > > test_array [0] =3D 0 > > > > =A0; > > =A0return 0; > > _ACEOF > > > > ...which is built with different values for $ac_mid. > > > > The difference between gforth-0.7.0 (where this fails) and 0.6.2 > > (where it was built successfully on hppa) seems to be that 0.7.0 > > uses a typedef to do the sizeof, whereas 0.6.2 did a straight > > sizeof (char *) in the test_array definition. =A0If this should make > > GCC fail on this code, I'd be quite surprised, but... it seems to > > be just so... :> > > Dave, what do you think of this code?
The C standard doesn't allow using an array to access memory outside the bounds of the array (that's not exactly right, but close enough). On hppa, doing this will result in a segv if -mdisable-indexing isn't specified. Much of Ada is built using this option. I haven't played with Forth in years, but I suspect it may also need to use -mdisable-indexing for certain code. Dave -- J. David Anglin [email protected] National Research Council of Canada (613) 990-0752 (FAX: 952-6602) -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

