From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6D3EF3858C50; Fri, 20 Jan 2023 20:15:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6D3EF3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674245714; bh=JjpAbcGSuGSQqGm4tGTOz7PEGCm++qfThar7Rz9kpQg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jDLWdfMYlOACxvwt3bto4pNY+gP2GUYxLzyQ0uy2ILtgAvXaOyw33oB5a5qhPO8o3 fTslVFxQ2mgujpp0JpS2PDVXc6QtZnFjSDc6jhl8V0Y+c3yj8EditIpgiaTptV+3hz NrG5E7ZNwvVINDcNPcE5JJmENP9RDh7iPSVOFpZI= From: "gcc-bugzilla at mkarcher dot dialup.fu-berlin.de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/108483] gcc warns about suspicious constructs for unevaluted ?: operand Date: Fri, 20 Jan 2023 20:15:14 +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: 10.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: gcc-bugzilla at mkarcher dot dialup.fu-berlin.de X-Bugzilla-Status: NEW 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=3D108483 --- Comment #3 from Michael Karcher --- Thanks for the pointer to #4210. Note that 4210 is slightly different, thou= gh. In that report, the condition and the warnable expression are in different statements, and https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D4210#c13 explicitly mentioned using a ternary expression to enable gcc to see the deadness of the code, using a flag called "skip_evaluation". This PR concerns a case that uses ?:, so I wonder whether skip_evaluation s= till exists, and could be used to gate the sizeof-pointer-div warning.=