Subject: Re: bug#8546: fix for Emacs pseudovector incompatibility with GCC 4.6.0

From: Stefan Monnier <[email-masked]>
Date: Tue, 26 Apr 2011 22:11:19 -0300

> OK, thanks, I added comments for that, and for the other areas where
> you requested comments, and merged it into the trunk.  I'll mark this
> bug as done.  This merge also fixes bug 8525, which I'll also mark.

So IIUC your answer to my question "why do we need the struct
vectorlike_header?" is

 /* Header of vector-like objects.  This documents the layout constraints on
    vectors and pseudovectors other than struct Lisp_Subr.  It also prevents
    compilers from being fooled by Emacs's type punning: the XSETPSEUDOVECTOR
    and PSEUDOVECTORP macros cast their pointers to struct vectorlike_header *,
    because when two such pointers potentially alias, a compiler won't
    incorrectly reorder loads and stores to their size fields.  See
    <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8546>.  */

But that doesn't explain why we need "struct vectorlike_header".
Since the macros could cast to "EMACS_UINT*" instead to access to size
field and that give us the same result.

        Stefan