From patchwork Thu Aug 17 04:05:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9904923 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2861660244 for ; Thu, 17 Aug 2017 04:05:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B72528414 for ; Thu, 17 Aug 2017 04:05:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1063528946; Thu, 17 Aug 2017 04:05:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB86C28414 for ; Thu, 17 Aug 2017 04:05:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750775AbdHQEF5 (ORCPT ); Thu, 17 Aug 2017 00:05:57 -0400 Received: from mail-wr0-f195.google.com ([209.85.128.195]:37369 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750755AbdHQEF4 (ORCPT ); Thu, 17 Aug 2017 00:05:56 -0400 Received: by mail-wr0-f195.google.com with SMTP id z91so3127138wrc.4 for ; Wed, 16 Aug 2017 21:05:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UJs1Llpf/TiMm+yeZ84Elh7PcoCFE26MYSSbX8+7rq8=; b=irDzA0eA3K92l2lFQarpm7xMcq7N8M5TJNAFD3EEJl4Rh4f3M+mYhaG4Sk6grdYGdS Bx23zlNjzDf5thgHoOJw7btzNkT4NECSVPd03yo7JzlmQqNv+5qls+eJnG53R/ul3a/D A48a4Prx0R4qxHdeQZuKS9qlcIH7KvKxSM//Kj1eipd2xsFFmdbMbwTBWZZY9MxwNzsp 8B85PZBX/qBqAWn6352hhLVVtMnRzVsYWYLHjecM6qLywIh2BBkN4YVcVbyBF+nMpbh5 mBY+UmQSLMRXU8++QsvCtUg2udtZuO90V0dTK7d+de6oQQN7WU58UlN+KmZdOcCZQTBA sMlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UJs1Llpf/TiMm+yeZ84Elh7PcoCFE26MYSSbX8+7rq8=; b=I0jxNyew9jTdzN+LWLL52AmKGwpu0BHdreI/+2bp9/RHb9nwv9yfxu5brgXCxGU+yO YsThVEDlyd3wqiwORXvEwv1BXnxA0rpiAx4w/zA3EjpueWXYgFoX7zqPv9hPuCGPHnEc 4yTgL50MyqNCiQn6OL5ZLsv5DWVzk0PGEn76D/u4iFB2rDjiyroFuspEylVnVorBfeML 6cHCVumOIXt73pDQ7X30wbPTYo/MLvUsUH7VREYXZkfr18nx0JsBN+paxEMNHyWWbvcs szcrKZf2uczoWxU7kFPaUhNVmyqznKnV76SkhTEh+KmRk79qyIjP+rJS0fo0ZI5XGvbd sIqg== X-Gm-Message-State: AHYfb5gOW1JNJM7ECwgwjhOsofvSqrPpC+jhF0cGWrU8ctGmApDJ6g+k Ok0pVAYlNg7OA1qERrM= X-Received: by 10.80.166.69 with SMTP id d63mr588151edc.32.1502942755307; Wed, 16 Aug 2017 21:05:55 -0700 (PDT) Received: from localhost.localdomain (1.84-65-87.adsl-dyn.isp.belgacom.be. [87.65.84.1]) by smtp.gmail.com with ESMTPSA id e12sm1378134edj.72.2017.08.16.21.05.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Aug 2017 21:05:54 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Linus Torvalds , Christopher Li , Dibyendu Majumdar , Luc Van Oostenryck Subject: [RFC PATCH 08/14] cast: make [u]intptr_ctype alias of [s]size_t_ctype Date: Thu, 17 Aug 2017 06:05:23 +0200 Message-Id: <20170817040529.7289-9-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170817040529.7289-1-luc.vanoostenryck@gmail.com> References: <20170817040529.7289-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When processing integer to/from pointers, we would like to have an integer type which has the same size as a pointer. Currently, it's always th case for [s]size_t but it's preferable to have a specific type which will always offer this guarantee, like [u]intptr_t. Fix this lazily by defining [u]intptr_ctype to [s]size_t_ctype. Note: this intptr_t is just internal to sparse and can be different from the type choosen by the libc/platform. Signed-off-by: Luc Van Oostenryck --- symbol.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/symbol.h b/symbol.h index 327449611..3e343e41e 100644 --- a/symbol.h +++ b/symbol.h @@ -270,6 +270,9 @@ extern struct symbol bool_ctype, void_ctype, type_ctype, incomplete_ctype, label_ctype, bad_ctype, null_ctype; +#define uintptr_ctype size_t_ctype +#define intptr_ctype ssize_t_ctype + /* Special internal symbols */ extern struct symbol zero_int;