GNU bug report logs - #11082
24.0.94; u.glyphless member in struct glyph does not fit in 32 bits

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Sat, 24 Mar 2012 05:55:01 UTC

Severity: normal

Found in version 24.0.94

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: 11082 <at> debbugs.gnu.org
Subject: bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 32 bits
Date: Sat, 24 Mar 2012 14:23:28 +0900
In dispextern.h:

   316	struct glyph
   317	{
(snip)
   418	  /* A union of sub-structures for different glyph types.  */
   419	  union
   420	  {
(snip)
   447	    /* Sub-stretch for type == GLYPHLESS_GLYPH.  */
   448	    struct
   449	    {
   450	      /* Value is an enum of the type glyphless_display_method.  */
   451	      unsigned method : 2;
   452	      /* 1 iff this glyph is for a character of no font. */
   453	      unsigned for_no_font : 1;
   454	      /* Length of acronym or hexadecimal code string (at most 8).  */
   455	      unsigned len : 4;
   456	      /* Character to display.  Actually we need only 22 bits.  */
   457	      unsigned ch : 26;
   458	    } glyphless;
   459	
   460	    /* Used to compare all bit-fields above in one step.  */
   461	    unsigned val;
   462	  } u;
   463	};

The member `u.glyphless' above requires at least 33 bits and does not
fit in the size (32 bits) of `u.val' on many environments.  As a
result, equality with respect to the `u.val' member (e.g., used in
GLYPH_EQUAL_P) does not necessarily mean the equality of glyphless
glyphs.

According to the comment above, it seems to be OK to shorten the
length of `u.glyphless.ch' member from 26 to 25.  Could someone
confirm this?

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp




This bug report was last modified 13 years and 138 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.