On Tue, Sep 08, 2009 at 12:17:47PM -0400, Carlos O'Donell wrote: > On Tue, Sep 8, 2009 at 11:54 AM, John David > Anglin<d...@hiauly1.hia.nrc.ca> wrote: > >> > =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. > > Thanks Dave. > > Peter, can you try adding -mdisable-indexing to the CFLAGS used for > this check when building for hppa?
Thanks a lot for the time, all of you! Actually, it turned out that the problem was not in this piece of code at all, that the configure script simply went down another code path and had another problem. The issue was that in 0.7.0, gforth's configure script got "smart enough" to know that it should add "-Xlinker -N" to the compiler flags, and "ld -N" complained loudly about not being able to find libgcc_s.so. Once I removed the -Xlinker -N flags, gforth built just fine, and passed its own test suite, and I could run a few simple tests of my own. I sent the RFS for the new version to the mentors list moments ago. Once again, thanks for all the assistance! G'luck, Peter -- Peter Pentchev r...@ringlet.net r...@space.bg r...@freebsd.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 If you think this sentence is confusing, then change one pig.
pgpDbgwzCzEjj.pgp
Description: PGP signature