emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

The --with-wide-int build and Lisp_Sub_Char_Table assertion


From: Eli Zaretskii
Subject: The --with-wide-int build and Lisp_Sub_Char_Table assertion
Date: Mon, 12 Jan 2015 18:29:52 +0200

This is a continuation of the discussion from several months ago,
which started here:

  http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00013.html

That discussion didn't reach any definite conclusion, AFAICT, and the
code was installed nonetheless.

Today, I tried building a 32-bit MinGW port --with-wide-int, and
immediately hit this static assertion:

  /* Make sure that sub char-table contents slot
     is aligned on a multiple of Lisp_Objects.  */
  verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
           - offsetof (struct Lisp_Sub_Char_Table, depth)) % word_size == 0);

In the 32-bit MinGW configuration with wide integers, we have:

  offsetof (struct Lisp_Sub_Char_Table, contents) = 16
  offsetof (struct Lisp_Sub_Char_Table, depth)    =  4
  word_size                                       =  8
  header_size                                     =  8
  offsetof(struct Lisp_Vector, contents)          =  8
  
and we immediately see that everything is fine, except the assertion
itself: it assumes that header_size and the offset of 'depth' have the
same value, which is false because header_size is the offset of
'contents' in a Lisp_Vector, not the size of 'struct vectorlike_header'
or the offset of 'depth' in a Lisp_Sub_Char_Table.

So I think the assertion should be changed to this:

  verify ((offsetof (struct Lisp_Sub_Char_Table, contents)
           - header_size) % word_size == 0);

Since there are too many possible configurations and ABIs out there,
with and without wide-int, I'm asking here whether someone sees a
problem with the above modification of this assertion.

TIA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]