From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gateway33.websitewelcome.com (gateway33.websitewelcome.com [192.185.145.216]) by sourceware.org (Postfix) with ESMTPS id 6A7FD3858426 for ; Wed, 8 Dec 2021 16:58:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6A7FD3858426 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tromey.com Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 2000854C8A3 for ; Wed, 8 Dec 2021 10:57:59 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id v0FQmsh0mPihzv0FRmv2OU; Wed, 08 Dec 2021 10:56:54 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=v1uHTElANO719nIKw8PTbigyn/HUw+TygAUeSPbqh7I=; b=myzcCFoDdpl4luEQZvzI60xRKk X2wGb+fneFwIZYaObZ6degOhx0yIxa0VlwwMDNpr1L/lmVHCrswalQFVXyeqOHZnNdSsbYO5VZGtS 89X3aHKqQEb0ORrI0EJoIPUb4; Received: from 97-122-84-67.hlrn.qwest.net ([97.122.84.67]:54290 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mv0FQ-002nBT-EA; Wed, 08 Dec 2021 09:56:52 -0700 From: Tom Tromey To: Simon Marchi via Gdb-patches Cc: Andrew Burgess , Simon Marchi Subject: Re: [PATCHv2 2/2] gdb/python: add Type.signedness attribute References: <5e9277cbad4e17099261ddc413bfb7471d3eb4f9.1638799543.git.aburgess@redhat.com> <20211208095657.GI123597@redhat.com> X-Attribution: Tom Date: Wed, 08 Dec 2021 09:56:51 -0700 In-Reply-To: (Simon Marchi via Gdb-patches's message of "Wed, 8 Dec 2021 08:35:57 -0500") Message-ID: <87sfv311d8.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.84.67 X-Source-L: No X-Exim-ID: 1mv0FQ-002nBT-EA X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-84-67.hlrn.qwest.net (murgatroyd) [97.122.84.67]:54290 X-Source-Auth: tom+tromey.com X-Email-Count: 1 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-Spam-Status: No, score=-3025.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Dec 2021 16:58:06 -0000 >>>>> "Simon" == Simon Marchi via Gdb-patches writes: Simon> Yet, the DWARF reader does: Simon> if (type->code () == TYPE_CODE_INT Simon> && name != nullptr Simon> && strcmp (name, "char") == 0) Simon> type->set_has_no_signedness (true); Simon> I'd like to know the rationale for this, it doesn't make sense to me. I think the intent is to mirror C semantics, where 'char' in one sense is signed or unsigned -- it may or may not sign-extend during promotion -- but is also officially different from both 'signed char' and 'unsigned char'. This weird quirk normally doesn't matter, but does affect overload resolution. I looked for uses of this flag, and overload (and the compile feature) are the spots where it seems to be used. Possible the Python API shouldn't bother with this, or there should be some separate thing for the "is this the C char type" case, because AFAIK that's the only such "signless" case anywhere. Tom