From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DB630395A43F; Mon, 11 Jul 2022 21:05:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DB630395A43F From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/106264] New: spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result Date: Mon, 11 Jul 2022 21:05:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 21:05:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106264 Bug ID: 106264 Summary: spurious -Wunused-value on a folded frexp, modf, and remquo calls with unused result Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- In C mode only the following test case triggers the invalid (or at least po= orly worded and so confusing) instances of -Wunused-value. Each instance goes a= way when the call is not folded or when its result is used. The C++ front end doesn't warn. $ cat a.c && gcc -O -Wall -S -Wall a.c double frexp (double, int*); double modf (double, double*); double remquo (double, double, int*); int f (void) { int y; frexp (1.0, &y); return y; } double g (void) { double y; modf (1.0, &y); return y; } int h (void) { int y; remquo (1.0, 1.0, &y); return y; } a.c: In function =E2=80=98f=E2=80=99: a.c:8:3: warning: right-hand operand of comma expression has no effect [-Wunused-value] 8 | frexp (1.0, &y); | ^~~~~~~~~~~~~~~ a.c: In function =E2=80=98g=E2=80=99: a.c:15:3: warning: right-hand operand of comma expression has no effect [-Wunused-value] 15 | modf (1.0, &y); | ^~~~~~~~~~~~~~ a.c: In function =E2=80=98h=E2=80=99: a.c:22:3: warning: right-hand operand of comma expression has no effect [-Wunused-value] 22 | remquo (1.0, 1.0, &y); | ^~~~~~~~~~~~~~~~~~~~~=