From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18666 invoked by alias); 23 May 2012 17:16:03 -0000 Received: (qmail 18654 invoked by uid 22791); 23 May 2012 17:16:01 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 23 May 2012 17:15:49 +0000 From: "jim.king at simplivity dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/49863] -Wunused-result not behaving correctly Date: Wed, 23 May 2012 17:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jim.king at simplivity dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg02289.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49863 James E. King, III changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jim.king at simplivity dot | |com --- Comment #3 from James E. King, III 2012-05-23 17:15:46 UTC --- I would like to recommend that this issue be re-opened. By leaving this issue alone, debug and optimized builds behave differently. I would like to have the same warnings enabled for both debug and optimized builds, and currently the only way to do that is to disable the unused result code checking for the release build. This seems counter-productive. If I declare -D_FORTIFY_SOURCE=2 on the command line, the headers should not override me just because it is not an optimized build. Is there some other unforeseen reason for this rule, such as that the compiler actually cannot check for this warning unless doing optimizations?