[13625] in Athena Bugs

home help back first fref pref prev next nref lref last post

Follow-up on 95q2 gcc problem.

daemon@ATHENA.MIT.EDU (Bill Cattey)
Fri Jun 30 16:24:19 1995

Date: Fri, 30 Jun 1995 16:24:00 -0400 (EDT)
From: Bill Cattey <wdc@MIT.EDU>
To: reidmp@MIT.EDU, bugs@MIT.EDU, developers@MIT.EDU, gnu@MIT.EDU

Consensus is that ANSI allows the eggregious answer returned by gcc in
the case documented by my gccbug.c program.

At issue is that the pointer values are not aligned on the sizeof the
struct freehdr.

We may discover that Cygnus/Gnu does not want to change the behavior of
the compiler.

In which case we should warn users:

If you do pointer arithmentic, make sure that the pointers are pointing
to valid references to the types of objects in your array.

If you are pointing to 24 byte structures, make sure that your array is
properly sized to hold an integral number of them.

If you are, as in our pathological case, re-implementing malloc, make
sure you cast the pointers back into char * if you are going to point
into the array at a non integral boundry.

-wdc

home help back first fref pref prev next nref lref last post