From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 538 invoked by alias); 17 Apr 2012 22:10:49 -0000 Received: (qmail 524 invoked by uid 22791); 17 Apr 2012 22:10:48 -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; Tue, 17 Apr 2012 22:10:01 +0000 From: "manu at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/51712] -Wtype-limits should not trigger for types of implementation-defined signedness Date: Tue, 17 Apr 2012 22:10: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: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: manu at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: 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" Content-Transfer-Encoding: quoted-printable 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-04/txt/msg01449.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D51712 --- Comment #5 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2012-04-17 21:27:25 UTC --- (In reply to comment #4) > I am not convinced clang's heuristic is the right one. For example, the > following code trips clang's warning, but the test is still not redundant= . The I can see that it doesn't handle this case, but it does handle two other co= mmon cases we don't want to warn about, namely, arg >=3D FOO and when the zero c= omes from a macro expansion. In any case, at the moment of the warning, GCC doesn't know that arg is an enum, and avoid warning. But perhaps this case is easier to fix than the one above.