From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7050 invoked by alias); 6 Dec 2012 18:27:31 -0000 Received: (qmail 6981 invoked by uid 48); 6 Dec 2012 18:27:05 -0000 From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/39464] [4.6/4.7/4.8 Regression] Attribute may_alias causes invalid warning Date: Thu, 06 Dec 2012 18:27: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: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 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" 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-12/txt/msg00588.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39464 --- Comment #11 from Jakub Jelinek 2012-12-06 18:27:03 UTC --- In any case, I'd limit the /* If there is a mismatch, do warn. */ else if (warn_pointer_sign) WARN_FOR_ASSIGNMENT (location, OPT_Wpointer_sign, G_("pointer targets in passing argument " "%d of %qE differ in signedness"), G_("pointer targets in assignment " "differ in signedness"), G_("pointer targets in initialization " "differ in signedness"), G_("pointer targets in return differ " "in signedness")); warning to actual sign differences only, i.e. else if (warn_pointer_sign && TYPE_UNSIGNED (mvl) != TYPE_UNSIGNED (mvr)) If we want to warn about other cases (I think they are generally outside of the scope of ISO C anyway), then we should have a differently worded warning after this one for the TYPE_UNSIGNED (mvl) == TYPE_UNSIGNED (mvr) case.