Subject: Re: bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow

From: Ken Brown <[email-masked]>
Date: Sat, 21 Jul 2018 08:42:09 -0400

On 7/21/2018 3:26 AM, Eli Zaretskii wrote:
>> Date: Sat, 21 Jul 2018 09:53:04 +0300
>> From: Eli Zaretskii <[email-masked]>
>> Cc: [email-masked], [email-masked]
>>
>> 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