From: Andreas Schwab <schwab@linux-m68k.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 11082@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 09:54:09 +0100 [thread overview]
Message-ID: <m27gyaqszy.fsf@linux-m68k.org> (raw)
In-Reply-To: <83zkb6trdb.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 24 Mar 2012 09:01:04 +0200")
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."
next prev parent reply other threads:[~2012-03-24 8:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-24 5:23 bug#11082: 24.0.94; u.glyphless member in struct glyph does not fit in 32 bits YAMAMOTO Mitsuharu
2012-03-24 7:01 ` Eli Zaretskii
2012-03-24 8:54 ` Andreas Schwab [this message]
2012-03-25 0:29 ` YAMAMOTO Mitsuharu
2012-03-26 5:47 ` Kenichi Handa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m27gyaqszy.fsf@linux-m68k.org \
--to=schwab@linux-m68k.org \
--cc=11082@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.