bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 3


From: Andreas Schwab
Subject: bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 32 bits
Date: Sat, 24 Mar 2012 09:54:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> 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.

This is broken since GLYPHLESS_GLYPH was added.

> ?? Isn't the size of a union defined by its widest member?

The size of u.val is defined by the size of unsigned.

> If so, we just end up wasting some storage here, but we should never
> truncate a bit field.

It's not about truncation, but about ignored bits in GLYPH_EQUAL_P.

> I would actually suggest to use 22-bit for this field, to avoid
> confusion in the future.

Making the struct exactly 32 bits may be better since it can make access
to the ch member simpler.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."





reply via email to

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