From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17291 invoked by alias); 11 Jan 2016 16:37:19 -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 17279 invoked by uid 89); 11 Jan 2016 16:37:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=IBM, ibm, Hx-languages-length:1421, warns X-HELO: mail-qk0-f196.google.com Received: from mail-qk0-f196.google.com (HELO mail-qk0-f196.google.com) (209.85.220.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 11 Jan 2016 16:37:18 +0000 Received: by mail-qk0-f196.google.com with SMTP id p186so20798108qke.2 for ; Mon, 11 Jan 2016 08:37:17 -0800 (PST) X-Received: by 10.55.79.207 with SMTP id d198mr159214527qkb.49.1452530236098; Mon, 11 Jan 2016 08:37:16 -0800 (PST) Received: from [192.168.0.26] (71-212-229-169.hlrn.qwest.net. [71.212.229.169]) by smtp.gmail.com with ESMTPSA id 100sm1558063qgi.17.2016.01.11.08.37.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Jan 2016 08:37:14 -0800 (PST) Message-ID: <5693DA38.9040602@gmail.com> Date: Mon, 11 Jan 2016 16:37:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Joseph Myers CC: Marek Polacek , GCC Patches Subject: Re: C PATCH to rectify warning for character types (PR c/23087) References: <20160107171127.GK31604@redhat.com> <568FF69B.10803@gmail.com> <56904612.800@gmail.com> <569060A2.8090101@gmail.com> In-Reply-To: <569060A2.8090101@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00613.txt.bz2 On 01/08/2016 06:21 PM, Martin Sebor wrote: >> The point of this warning is that there are certain cases of incompatible >> types that are less serious than others - namely, those where the only >> aspect of the type that is different is its signedness. Those get a more >> specific warning, which is given under more restrictive conditions. FWIW, below is a survey of a few popular compilers I have access to and how they treat the problem and under what option. The C code I used to test is: void foo (char *p, signed char *q) { q = p; } Clang (controlled by -Wpointer-sign, enabled by default): warning: assigning to 'signed char *' from 'char *' converts between pointers to integer types with different sign [-Wpointer-sign] EDG eccp (warns by default): warning: a value of type "char *" cannot be assigned to an entity of type "signed char *" Intel ICC (requires -Wpointer-sign): warning #556: a value of type "char *" cannot be assigned to an entity of type "signed char *" Oracle CC (warns by default): warning: assignment type mismatch: pointer to signed char "=" pointer to char IBM XLC (warns by default): 1506-068 (W) Operation between types "signed char*" and "char*" is not allowed. Visual C (rejects code by default): error C2440: '=': cannot convert from 'char *' to 'signed char *' note: Types pointed to are unrelated; Martin