all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 32230@debbugs.gnu.org, eggert@cs.ucla.edu
Subject: bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow
Date: Sat, 21 Jul 2018 08:42:09 -0400	[thread overview]
Message-ID: <98054dba-8229-9625-d02a-af7fbd06a9d7@cornell.edu> (raw)
In-Reply-To: <83effxyrqg.fsf@gnu.org>

On 7/21/2018 3:26 AM, Eli Zaretskii wrote:
>> Date: Sat, 21 Jul 2018 09:53:04 +0300
>> From: Eli Zaretskii <eliz@gnu.org>
>> Cc: 32230@debbugs.gnu.org, eggert@cs.ucla.edu
>>
>> But do you understand why it says "between 5 and 8 bytes"?  The
>> corresponding argument to snprintf is either 4 or 6, so it should be
>> between 5 and 7.  Where could the extra byte come from?  Is that
>> because glyphless.ch is a 25-bit field?

Yes.  Changing the field size to 24 silences the warning.

> I meant sprintf, of course.  And if the above is the reason, then
> perhaps using something like
> 
>    (unsigned int) glyph->u.glyphless.ch & 0xffffff
> 
> is a cleaner solution (assuming it shuts up the warning)?

Yes, it does shut up the warning.  Thanks, I'll make that change.  I 
assume it should go to master, or would you rather have it in the 
emacs-26 branch?

Ken






  reply	other threads:[~2018-07-21 12:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 22:02 bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow Ken Brown
2018-07-21  6:53 ` Eli Zaretskii
2018-07-21  7:26   ` Eli Zaretskii
2018-07-21 12:42     ` Ken Brown [this message]
2018-07-21 12:47       ` Eli Zaretskii
2018-07-21 16:26         ` Ken Brown
2018-07-21 16:40           ` Eli Zaretskii

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=98054dba-8229-9625-d02a-af7fbd06a9d7@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=32230@debbugs.gnu.org \
    --cc=eggert@cs.ucla.edu \
    --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.