From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#32230: 27.0.50; GCC 7 warning due to -Wformat-overflow Date: Sat, 21 Jul 2018 09:53:04 +0300 Message-ID: <83fu0dyt9r.fsf@gnu.org> References: <2d9037f1-e52f-f3ca-7c53-e203ea6ae520@cornell.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1532155927 10598 195.159.176.226 (21 Jul 2018 06:52:07 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 21 Jul 2018 06:52:07 +0000 (UTC) Cc: 32230@debbugs.gnu.org, eggert@cs.ucla.edu To: Ken Brown Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jul 21 08:52:03 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 1fglkJ-0002cP-65 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 08:52:03 +0200 Original-Received: from localhost ([::1]:50930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fglmO-0001Jm-Iw for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Jul 2018 02:54:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fglmI-0001JU-OE for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 02:54:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fglmE-0008Ad-Nf for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 02:54:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fglmE-0008AX-Iu for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 02:54:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fglmE-0006eS-3S for bug-gnu-emacs@gnu.org; Sat, 21 Jul 2018 02:54:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jul 2018 06:54:02 +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.153215599625513 (code B ref 32230); Sat, 21 Jul 2018 06:54:02 +0000 Original-Received: (at 32230) by debbugs.gnu.org; 21 Jul 2018 06:53:16 +0000 Original-Received: from localhost ([127.0.0.1]:50126 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgllU-0006dR-6O for submit@debbugs.gnu.org; Sat, 21 Jul 2018 02:53:16 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgllS-0006dC-Fb for 32230@debbugs.gnu.org; Sat, 21 Jul 2018 02:53:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgllM-0007l0-8v for 32230@debbugs.gnu.org; Sat, 21 Jul 2018 02:53:09 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgllH-0007i9-4b; Sat, 21 Jul 2018 02:53:03 -0400 Original-Received: from [176.228.60.248] (port=3531 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fgllG-0003WD-F8; Sat, 21 Jul 2018 02:53:02 -0400 In-reply-to: <2d9037f1-e52f-f3ca-7c53-e203ea6ae520@cornell.edu> (message from Ken Brown on Fri, 20 Jul 2018 18:02:07 -0400) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] 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:148758 Archived-At: > From: Ken Brown > Date: Fri, 20 Jul 2018 18:02:07 -0400 > Cc: Paul Eggert > > The Cygwin-w32 build has turned up another GCC 7 warning: > > ../../master/src/w32term.c: In function ‘x_draw_glyph_string’: > ../../master/src/w32term.c:1477:27: warning: ‘__builtin___sprintf_chk’ > may write a terminating nul past the end of the destination > [-Wformat-overflow=] > sprintf ((char *) buf, "%0*X", > ^ > ../../master/src/w32term.c:1477:4: note: ‘__builtin___sprintf_chk’ > output between 5 and 8 bytes into a destination of size 7 > sprintf ((char *) buf, "%0*X", > ^ > The method that Paul used in bug#32189 could be used here too, but I'm > not sure it's worth the trouble. My inclination is to just increase the > buffer size from 7 to 8. Yes, with a comment explaining why 8. 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?