all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* The --with-wide-int build and Lisp_Sub_Char_Table assertion
@ 2015-01-12 16:29 Eli Zaretskii
  2015-01-12 17:03 ` Dmitry Antipov
  2015-01-12 19:30 ` Paul Eggert
  0 siblings, 2 replies; 8+ messages in thread
From: Eli Zaretskii @ 2015-01-12 16:29 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-13 16:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-12 16:29 The --with-wide-int build and Lisp_Sub_Char_Table assertion Eli Zaretskii
2015-01-12 17:03 ` Dmitry Antipov
2015-01-12 17:26   ` Eli Zaretskii
2015-01-12 18:32     ` Dmitry Antipov
2015-01-12 18:43       ` Eli Zaretskii
2015-01-12 17:58   ` Andreas Schwab
2015-01-12 19:30 ` Paul Eggert
2015-01-13 16:14   ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.