From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71343 invoked by alias); 7 Jan 2016 21:19:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 71329 invoked by uid 89); 7 Jan 2016 21:19:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=turning, leaning, rectify, gcc7 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Jan 2016 21:19:51 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-02.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1aHHyF-0005uF-LA from joseph_myers@mentor.com ; Thu, 07 Jan 2016 13:19:47 -0800 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server id 14.3.224.2; Thu, 7 Jan 2016 21:19:46 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.82) (envelope-from ) id 1aHHyC-0000QP-Fk; Thu, 07 Jan 2016 21:19:44 +0000 Date: Thu, 07 Jan 2016 21:19:00 -0000 From: Joseph Myers To: Marek Polacek CC: GCC Patches Subject: Re: C PATCH to rectify warning for character types (PR c/23087) In-Reply-To: <20160107171127.GK31604@redhat.com> Message-ID: References: <20160107171127.GK31604@redhat.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2016-01/txt/msg00359.txt.bz2 On Thu, 7 Jan 2016, Marek Polacek wrote: > This PR points out that we issue a wrong warning message when assigning > two pointers when one of them is plain char. In that case, the compiler > currently says that pointer targets differ in signedness. But that is > not correct; char is a separate type from (un)signed char and is not > compatible with either. So we should instead say that the pointer types > are not compatible. > > This effectively means that I'm turning a -Wpointer-sign warning into > a -Wincompatible-pointer-types warning. But -Wincompatible-pointer-types > is a warning that is enabled by default and -Wpointer-sign is enabled by > -Wpedantic || -Wall. So with this, we'd be more verbose and would warn > by default on e.g. "unsigned char *p = "foo";." Not sure if that is > desirable at this stage, so I'm leaning towards pushing this patch for > GCC7. I don't think it's desirable to raise the warning for this case under different conditions from the warning for other signedness cases. The targets do differ in signedness - it's just that the difference is between "plain" and "signed" or "plain" and "unsigned", not between signed and unsigned. Maybe the warning message should be more specific in this case, but not a less-specific "incompatible" which is what this patch would achieve. -- Joseph S. Myers joseph@codesourcery.com