----- Original Message ----- From: "Bruce Momjian" <[EMAIL PROTECTED]> > > I have backed out the patch. > > Looking at the case in tablecmds.c and proc.c, the first was assigning a > struct with a NodeTag pointer as its first element to another struct > with NodeTag as its first element. In fact, we do this all over the > place, having different structure pointers with a start element of > NodeTag.
Right - and it is what would have to change if you really want to obey the ISO C rules, I believe. This is handled easily in other languages using variant records, but C is kinda primitive here :-) As I understand it, instead of struct foo { int tag foostuff f; } struct bar { int tag; barstuff b; } you would need to do something like struct foo { foostuff f; }; struct bar { barstuff b; }; struct foobar { int tag; union { struct foo foo; struct bar bar; } v; }; > The proc.c cases were using MemSet, which was checking if the > int* as aligned for int* access. In fact, we could change MemSet to > always take a void *, and do the int* casting when we access it after > testing for alignment. > Since MemSet is generic, that is probably a good idea. > The big question in my mind is whether there there is other struct * > passing that could be masked right now by void* casting, and if so, do > they have different first elements? This determined whether we do > -fstrict-aliasing for gcc, or fix just these few cases. Just analysing this is a non-trivial piece of work, I think. cheers andrew ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend