From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 43884 invoked by alias); 28 May 2015 10:31:38 -0000 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 Received: (qmail 43776 invoked by uid 48); 28 May 2015 10:31:33 -0000 From: "nszabolcs at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/66322] Linus Torvalds: -Wswitch-bool produces dubious warnings, fails to notice really bad things Date: Thu, 28 May 2015 10:31: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-Version: 5.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: nszabolcs at gmail dot com 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: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-05/txt/msg02341.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66322 Szabolcs Nagy changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nszabolcs at gmail dot com --- Comment #5 from Szabolcs Nagy --- i don't mind the warning (there are other warnings in gcc with false positives), but the documentation must not encourage the use of casts for dealing with it. that is dangerous and much worse than the original problem: the cast turns off the type-system so if the type of the expression later changes then anything goes (pointers, floats, different int types). so i think this is the real bug: https://gcc.gnu.org/onlinedocs/gcc-5.1.0/gcc/Warning-Options.html#index-Wswitch-bool-362