From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 88E0A3858D3C; Fri, 26 May 2023 07:23:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 88E0A3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685085805; bh=IrIhpeWQpf/UNnp95EsncuP2uoXS4CWGyb0LE4iJoCU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=f+cnOMDWzf5hJGdOBrUf0C09P2ye5VIwWOLZsFla3CXgxMNTVxVjgtt/giLdBPTV7 PxQTlH7uiLVt2SuHlRbAIoKqZQmXPcViTzQOHG4saoNbjRKE6vCGtWl29z+iC5g6hh jlIjK4+4R7cxauKIhiyg5gMo0cv8BGm5DWUXcf2s= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109979] -Wformat-overflow false positive for %d and non-basic expression Date: Fri, 26 May 2023 07:23:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords short_desc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109979 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Summary|[12 Regression] |-Wformat-overflow false |-Wformat-overflow false |positive for %d and |positive for %d and |non-basic expression |non-basic expression | --- Comment #2 from Andrew Pinski --- The warning happens in GCC 8+ with -O1 and above too ... Really the warning should have happened for the first sprintf too because e= ven though e has no range, it still can overflow the buffer.=