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#32189: 27.0.50; GCC 7 warning due to -Wformat-truncation=2 Date: Thu, 19 Jul 2018 16:25:09 +0300 Message-ID: <83k1pr2w96.fsf@gnu.org> References: <031d18cf-e661-6dea-8882-38d75924d0d4@cornell.edu> <83601c4m37.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1532006657 26140 195.159.176.226 (19 Jul 2018 13:24:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 19 Jul 2018 13:24:17 +0000 (UTC) Cc: 32189@debbugs.gnu.org To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 19 15:24:13 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 1fg8ui-0006iK-Q6 for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jul 2018 15:24:12 +0200 Original-Received: from localhost ([::1]:42874 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg8wp-0003qx-KE for geb-bug-gnu-emacs@m.gmane.org; Thu, 19 Jul 2018 09:26:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54029) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg8wZ-0003nx-7W for bug-gnu-emacs@gnu.org; Thu, 19 Jul 2018 09:26:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg8wU-0006Mo-76 for bug-gnu-emacs@gnu.org; Thu, 19 Jul 2018 09:26:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:42635) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fg8wU-0006Mb-2u for bug-gnu-emacs@gnu.org; Thu, 19 Jul 2018 09:26:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fg8wT-0004bW-Nx for bug-gnu-emacs@gnu.org; Thu, 19 Jul 2018 09:26:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 19 Jul 2018 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32189 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32189-submit@debbugs.gnu.org id=B32189.153200672317652 (code B ref 32189); Thu, 19 Jul 2018 13:26:01 +0000 Original-Received: (at 32189) by debbugs.gnu.org; 19 Jul 2018 13:25:23 +0000 Original-Received: from localhost ([127.0.0.1]:47653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fg8vq-0004ae-Oj for submit@debbugs.gnu.org; Thu, 19 Jul 2018 09:25:23 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fg8vp-0004aR-Qd for 32189@debbugs.gnu.org; Thu, 19 Jul 2018 09:25:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg8vf-0005rA-P6 for 32189@debbugs.gnu.org; Thu, 19 Jul 2018 09:25:16 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53183) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg8vf-0005r6-Kf; Thu, 19 Jul 2018 09:25:11 -0400 Original-Received: from [176.228.60.248] (port=4973 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fg8vf-0005v5-0r; Thu, 19 Jul 2018 09:25:11 -0400 In-reply-to: (message from Philipp Stephani on Thu, 19 Jul 2018 08:10:20 +0200) 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:148669 Archived-At: > From: Philipp Stephani > Date: Thu, 19 Jul 2018 08:10:20 +0200 > Cc: Eli Zaretskii , 32189@debbugs.gnu.org > > This doesn't work with GCC 7. (Maybe it would work with GCC 8; the > release notes say that it is better at avoiding false positives.) For > integer specifiers like "%ld", the only thing I've found that works > without enlarging the buffer is to cast the argument to a smaller > integer type. > > You can't do that; %ld requires a long argument, and casting results in undefined behavior. We can assign instead, and since the value is known to be small enough, doing that won't lose bits.