From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow Date: Sat, 21 Jul 2018 08:42:09 -0400 Message-ID: <98054dba-8229-9625-d02a-af7fbd06a9d7@cornell.edu> References: <2d9037f1-e52f-f3ca-7c53-e203ea6ae520@cornell.edu> <83fu0dyt9r.fsf@gnu.org> <83effxyrqg.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1532176873 8295 195.159.176.226 (21 Jul 2018 12:41:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 12:41:13 +0000 (UTC) User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 Cc: 32230@debbugs.gnu.org, eggert@cs.ucla.edu To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 14:41:09 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgrC8-00024h-UZ for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 14:41:09 +0200 Original-Received: from localhost ([::1]:52103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgrEF-00077D-RY for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 08:43:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgrE2-00074a-2F for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 08:43:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgrDy-0005JS-BV for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 08:43:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45286) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fgrDy-0005JK-0Q for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 08:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fgrDx-0002DB-Oq for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 08:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jul 2018 12:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32230 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32230-submit@debbugs.gnu.org id=B32230.15321769428452 (code B ref 32230); Sat, 21 Jul 2018 12:43:01 +0000 Original-Received: (at 32230) by debbugs.gnu.org; 21 Jul 2018 12:42:22 +0000 Original-Received: from localhost ([127.0.0.1]:50304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgrDK-0002CG-4K for submit@debbugs.gnu.org; Sat, 21 Jul 2018 08:42:22 -0400 Original-Received: from limerock04.mail.cornell.edu ([128.84.13.244]:59634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgrDI-0002C0-FN for 32230@debbugs.gnu.org; Sat, 21 Jul 2018 08:42:20 -0400 X-CornellRouted: This message has been Routed already. Original-Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id w6LCgCSm022402; Sat, 21 Jul 2018 08:42:12 -0400 Original-Received: from [192.168.0.15] (mta-68-175-129-7.twcny.rr.com [68.175.129.7] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id w6LCgAbY013580 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 21 Jul 2018 08:42:11 -0400 In-Reply-To: <83effxyrqg.fsf@gnu.org> Content-Language: en-US X-PMX-Cornell-Gauge: Gauge=XXXXX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148776 Archived-At: On 7/21/2018 3:26 AM, Eli Zaretskii wrote: >> Date: Sat, 21 Jul 2018 09:53:04 +0300 >> From: Eli Zaretskii >> 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