From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 69035385E008; Wed, 14 Feb 2024 11:32:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69035385E008 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707910353; bh=J+t9SUplQYiIVXPBKVoLwVEM4sN9SZbOI9lcqWF0K6Y=; h=From:To:Subject:Date:In-Reply-To:References:From; b=PCgDmTJ6NRhPefzMGGVxOKaNpUtsG3molc2M/qJl/znCMFsc19hK50i1kGJkzrvjW crtxTI38+uiRcnf8C5PITiRJ3GGUKz2zpqK9HZ3qXOnqsp5xjNShEvoPXl4GGWBCUN j0LYEaULso+MDJavRREf8oC/yD51CnmOmHS3pvT8= From: "groessler_christian at yahoo dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result)) Date: Wed, 14 Feb 2024 11:32:23 +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: 4.9.2 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: groessler_christian at yahoo dot de 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: cc 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=3D66425 Christian Groessler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |groessler_christian at yah= oo dot d | |e --- Comment #62 from Christian Groessler --- (In reply to Segher Boessenkool from comment #60) > So you want to not warn for some (just *some*) explicitly unused cases, a= nd > do > warn for other explicitly unused cases, and all implicitly unused cases?= =20 > While > the author of the code explicitly asked for a warning message to be emitt= ed > in > all such cases: "The 'warn_unused_result' attribute causes a warning to be > emitted if a caller of the function with this attribute does not use its > return > value." Yes! I'm write()ing to a pipe a small amount of data (< page size), and any= way don't know how to continue if the write() fails. It would be noticed at the other end. (void)write(....) doesn't suppress the warning. Annoying...=