From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A249B3858421; Fri, 26 May 2023 21:31:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A249B3858421 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685136705; bh=g9Po0Rv0qDjY4VP9xLIUT4y+lJsDjgtHZBUZ32VwWTQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=CSNI9lDvH6xsCUuM8QqTp/exYYl0Tv5NcTOcuxgWkPeUZyL60EKM7+D6CbRGJALwf R0bZCAbRto+0mFszroKOYEZPk6mHlLFIMR8XaxacbCooK6xbWXkn3MojArDfsRA17I 3dHnU50HyZATECTyOmx2Jj1XP38sYGjtjBpcabMU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109970] -Wstringop-overflow should work with parameter forward declarations Date: Fri, 26 May 2023 21:31:45 +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: 14.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit 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: 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=3D109970 --- Comment #1 from CVS Commits --- The master branch has been updated by Martin Uecker : https://gcc.gnu.org/g:8d6bd830f5f9c939e8565c0341a0c6c588834484 commit r14-1304-g8d6bd830f5f9c939e8565c0341a0c6c588834484 Author: Martin Uecker Date: Fri May 26 11:19:01 2023 +0200 c: -Wstringop-overflow for parameters with forward-declared sizes Warnings from -Wstringop-overflow do not appear for parameters declared as VLAs when the bound refers to a parameter forward declaration. This is fixed by splitting the loop that passes through parameters into two, first only recording the positions of all possible size expressions and then processing the parameters. PR c/109970 gcc/c-family: * c-attribs.cc (build_attr_access_from_parms): Split loop to fi= rst record all parameters. gcc/testsuite: * gcc.dg/pr109970.c: New test.=