From patchwork Mon Nov 11 13:47:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237017 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8525D159A for ; Mon, 11 Nov 2019 13:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 636F2206A3 for ; Mon, 11 Nov 2019 13:47:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="uB9Z3VR3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727023AbfKKNrz (ORCPT ); Mon, 11 Nov 2019 08:47:55 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:39631 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726902AbfKKNrz (ORCPT ); Mon, 11 Nov 2019 08:47:55 -0500 Received: by mail-wm1-f68.google.com with SMTP id t26so13270389wmi.4 for ; Mon, 11 Nov 2019 05:47:53 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=cf5lx7sIDNj0JW07prjcK3ck6kRBbHvHMdBZaYZdeWY=; b=uB9Z3VR3DrHxohpewMtEOawgZo9Xa3Ux7XRx1y9RAcy8K9BF+WDVjTGDfmRsELvgYX 7ZTRD8VuFrddaeZSci/hnqRd0BlZ4IexBdzsD30wJ+fZo9kNvu490HnPgK78BBMbIHeI ZuraEOUhm32agda+EDi1nmECpMtU34Z9HA7d5ZS8GhBehT7ZkRhejkc3BCT4FDi5eGDx qmUhrSO/5e6vEPgy16SUowsKKFC8HWfvx2b0a5mQP4LzoDay5p/gMFHhz5h/SB+xO7dq O+2NlubIO/BEQGPPgSrZvuVI0KAJM0PNPkPNWbJEEyEeC1QQMrDhwXLWbdBhrEcUFEw1 Jesw== 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:mime-version:content-transfer-encoding; bh=cf5lx7sIDNj0JW07prjcK3ck6kRBbHvHMdBZaYZdeWY=; b=Xb72XfGiivd6KHN/gWCv2tUdz8Vs1jWJKvwcK/Vp4L0aT2ab3DJNV5NohYmvPI+cUy /0pyGooj7InYEMeAXhGSZvDMwSoPJEd3eCjpE25y9lOIp4QOtLb84BH8eoe9teT1NM6F L6hUxQVWRzELri/l9fRdfD29amRHDdBlD+U/3dwCQk9Gosndd+6mGEts1qWOTmncY3sw OGp4ZovX/yNXozcqMHfkSAXNSav4IQQ993RAaxlr7xi4PKDc/jHhn0DBf7wCf7Zw1nyV /OEw925DuYSJVkVi4UG2vqgrz7EGBOvIBxCDGwbtXYpdoUlsMCIyxG5V2SgwxCfggXtd GCYg== X-Gm-Message-State: APjAAAV4y6VBcWmrI2k+ysqudfT5IqCcCUI2d1hsNpBeEk7O6qjejnXQ aPdosSGSQ5rS8H50P1VgrVflVZAs X-Google-Smtp-Source: APXvYqw1VAgavg1/EMLink1fGywO+ydAsoj1ll7u7kGZrwyUT296nzICvWT5HBZKMDWH6KOR8fqaWw== X-Received: by 2002:a1c:6405:: with SMTP id y5mr22164489wmb.175.1573480072828; Mon, 11 Nov 2019 05:47:52 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:52 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 1/9] spec: process chars like other integer types Date: Mon, 11 Nov 2019 14:47:39 +0100 Message-Id: <20191111134747.79516-2-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org When parsing specifiers, Sparse process chars independently of other integers. But this is not necessary (as long as the proper see/test/set flags are correct). Change this by processing chars the same as other integers but 'below' shorts. Signed-off-by: Luc Van Oostenryck --- parse.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/parse.c b/parse.c index 4b0a1566c..66e177561 100644 --- a/parse.c +++ b/parse.c @@ -112,7 +112,7 @@ enum { }; enum { - CInt = 0, CSInt, CUInt, CReal, CChar, CSChar, CUChar, + CInt = 0, CSInt, CUInt, CReal, }; enum { @@ -248,7 +248,7 @@ static struct symbol_op char_op = { .type = KW_SPECIFIER, .test = Set_T|Set_Long|Set_Short, .set = Set_T|Set_Char, - .class = CChar, + .class = CInt, }; static struct symbol_op int_op = { @@ -1554,20 +1554,18 @@ Catch_all: } static struct symbol * const int_types[] = - {&short_ctype, &int_ctype, &long_ctype, &llong_ctype, &lllong_ctype}; + {&char_ctype, &short_ctype, &int_ctype, &long_ctype, &llong_ctype, &lllong_ctype}; static struct symbol * const signed_types[] = - {&sshort_ctype, &sint_ctype, &slong_ctype, &sllong_ctype, + {&schar_ctype, &sshort_ctype, &sint_ctype, &slong_ctype, &sllong_ctype, &slllong_ctype}; static struct symbol * const unsigned_types[] = - {&ushort_ctype, &uint_ctype, &ulong_ctype, &ullong_ctype, + {&uchar_ctype, &ushort_ctype, &uint_ctype, &ulong_ctype, &ullong_ctype, &ulllong_ctype}; static struct symbol * const real_types[] = {&float_ctype, &double_ctype, &ldouble_ctype}; -static struct symbol * const char_types[] = - {&char_ctype, &schar_ctype, &uchar_ctype}; static struct symbol * const * const types[] = { - int_types + 1, signed_types + 1, unsigned_types + 1, - real_types + 1, char_types, char_types + 1, char_types + 2 + int_types + 2, signed_types + 2, unsigned_types + 2, + real_types + 1, }; struct symbol *ctype_integer(int size, int want_unsigned) @@ -1625,6 +1623,8 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta size = 2; if (s->op->type & KW_SHORT) { size = -1; + } else if (s->op->set & Set_Char) { + size = -2; } else if (s->op->type & KW_LONG && size++) { if (class == CReal) { specifier_conflict(token->pos, From patchwork Mon Nov 11 13:47:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237015 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E4B11515 for ; Mon, 11 Nov 2019 13:47:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0570222CA for ; Mon, 11 Nov 2019 13:47:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jAROp6cI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfKKNr4 (ORCPT ); Mon, 11 Nov 2019 08:47:56 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42084 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbfKKNr4 (ORCPT ); Mon, 11 Nov 2019 08:47:56 -0500 Received: by mail-wr1-f66.google.com with SMTP id a15so14679420wrf.9 for ; Mon, 11 Nov 2019 05:47:54 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=k0qZxuOZuL7wqPkIPj+ERG9EButLGA2j8eOYs2tEmrI=; b=jAROp6cIjOLbcsDMaS1OgkORQk9fKH2tqmsxm7aX9TeRlwqonp+uhEYbQChnVOOqLS mhZ/+Msx1UwugTEJnkq5NbmILItunEw+7gcVFbvehjFf9mNCkWSRHtFAGDW79Me7to1F XxXGDkxE/c7eZKhs8B0wfp4tXmBu4OCjOZanBYggxy4jzVJz7K8hMLo86QM9IvI76tkX uxc0quYE3ZUCtQjfvuTmcmJU5s9soJEplcSsHapjStP7O4YwYDL2FdgQGXB/qN8GzSLW Qq8oYMR3ski+CbTF2FNAlJi5/KBKPPcwxlnUlYBMkE/yBuYqTo3amh/6t9Eru4mvbwkB ZiLw== 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:mime-version:content-transfer-encoding; bh=k0qZxuOZuL7wqPkIPj+ERG9EButLGA2j8eOYs2tEmrI=; b=n89MomFmW8gTllDPqyHKj7ouPRCbpIGNUGdcOS1JvAF0bFGdwAtnyWXePo8suvh8aw 0RRNFWZaGy0J5zv20Z6TziB8tI3wYG1pCyVfJlUmcg814Z1Y20NuexconGxMtmC1obhY w9pytKMbxG1c6l0Wl9fjcoH8w2IOYLCh4u8jXSrauHFYYobt5P0xPRBORjkaSFvr6SrX I4pyh4YDpQ3qn1DIsTkArg+YTB4f6zXz54vDTXnJNZFOpugWk5Q14Z9Mo6xKcuSiBLiA 3F0wMXKvNSnEjzfuC2yUI87NgPKRd7c/w7JFYyikBCuq/jqJisvLFmhVqrNcebQz0d96 UkgA== X-Gm-Message-State: APjAAAUXWN0au2D/XUiXISQhyYntr7e6myD0JA9QZQP2K3+0HBB/HuKZ eCCXz+94n68hq394Eya5MhLkUqHF X-Google-Smtp-Source: APXvYqwzaDaPP1zWliPgnoNslsf0Vi63/BxaMI0fFsXEkha7lXfMVwllTBiZikMEi4C/Uwe95HAPyQ== X-Received: by 2002:adf:b7c2:: with SMTP id t2mr18314874wre.47.1573480073778; Mon, 11 Nov 2019 05:47:53 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:53 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 2/9] spec: types[] is indexed by the specifier class Date: Mon, 11 Nov 2019 14:47:40 +0100 Message-Id: <20191111134747.79516-3-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org The array types[] is initialized without using 'designators' but the entries are in fact indexed by the 'class'. Make this clear by using the 'class' constant (CInt, CUInt, CSInt & CReal) as designator in the table initializer. Signed-off-by: Luc Van Oostenryck --- parse.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parse.c b/parse.c index 66e177561..d544ba51e 100644 --- a/parse.c +++ b/parse.c @@ -1564,8 +1564,10 @@ static struct symbol * const unsigned_types[] = static struct symbol * const real_types[] = {&float_ctype, &double_ctype, &ldouble_ctype}; static struct symbol * const * const types[] = { - int_types + 2, signed_types + 2, unsigned_types + 2, - real_types + 1, + [CInt] = int_types + 2, + [CSInt] = signed_types + 2, + [CUInt] = unsigned_types + 2, + [CReal] = real_types + 1, }; struct symbol *ctype_integer(int size, int want_unsigned) From patchwork Mon Nov 11 13:47:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237019 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5BB41159A for ; Mon, 11 Nov 2019 13:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A2AB206A3 for ; Mon, 11 Nov 2019 13:47:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="hKAcR5J5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727054AbfKKNr6 (ORCPT ); Mon, 11 Nov 2019 08:47:58 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:41326 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbfKKNr6 (ORCPT ); Mon, 11 Nov 2019 08:47:58 -0500 Received: by mail-wr1-f66.google.com with SMTP id p4so14694776wrm.8 for ; Mon, 11 Nov 2019 05:47:55 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=97YJSEq7BX10NRVZhpJwMOnDFdAFQk1/HswUyq8kVZc=; b=hKAcR5J5w+mDNr5Zd23vPoe3SOcAQVWH3wZkzY54F+GSrHoqcfUMsmms0XDrdzw5ql GB4awopbsBkK/MnXFoYINe2EVNhS4t98W87vTjLp0L/DhIYFlNG0K+F+Svgb6/O49Grc obcc2v9lCh4nYqPAAgiRO2gSYrBMGs5kvkAEJE4oMS3Na+KM6WywkrNFXknuSrE58qKM GEEZMe+O/nhTEtV1A/EViXUVp6W0BeeTXQtSxgJwig+spZBAAhCxQMkb2pSjc3ZxmNCW SyCu3pgRJVhGT/Pd1ZsopVro3tnjI9D/2lWIJ3RjL/CfrE/E8q+UA2HmieN0QOETHAm1 gycA== 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:mime-version:content-transfer-encoding; bh=97YJSEq7BX10NRVZhpJwMOnDFdAFQk1/HswUyq8kVZc=; b=Rph+bSjHOkOurMGygRSm2daJbf9Y1IUReVnaql5mxHWt1x5pUjvICqGqRQIFqyJTX3 PfuPtqBB5gh4wW5dC1vysZFtIeOla27kuRK9MrZcsJsKSwLenEYzQ+vj/m7KrbpPSbIm O7WQTHYXvphDcK74SePROHJKaQrLradX6V8a7xiTAlLzbgYcurhRX3MqR7juE8upIyCy VRzSjnlsZpJ/7HZPavqn9Bo9UVgzw1JdAtKZF9l08yz7bsjuPmhTMK8sfQBWtH8x5Mhg CxU/ec5RdIYaiCCFVTkr02r9/b8ZNXyFIOAD+oplAf/BQYaQQmnTq2SDaYNwH3K/ZIT1 OqjA== X-Gm-Message-State: APjAAAUO7vds5mlHMreJcxMneyCntJ/jm+3pqeH+2DuQd7KwLhAPTP5y B197E0zterku9Ia8JELYtLevaxSU X-Google-Smtp-Source: APXvYqw5uAzRlQFg2aRaG6YqfcBvDdruk1TFgZu8sewtNr6zGomHK/0D9qbRrqTr4F3RjczaqKiogw== X-Received: by 2002:adf:b1cb:: with SMTP id r11mr14338510wra.246.1573480074680; Mon, 11 Nov 2019 05:47:54 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:54 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 3/9] spec: add '.class = CInt' Date: Mon, 11 Nov 2019 14:47:41 +0100 Message-Id: <20191111134747.79516-4-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Add it for the specifier that implies an integer type. Since Cint is (and must be) zero, it changes nothing but it helps a little for as documentation. Signed-off-by: Luc Van Oostenryck --- parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/parse.c b/parse.c index d544ba51e..797b3971e 100644 --- a/parse.c +++ b/parse.c @@ -255,6 +255,7 @@ static struct symbol_op int_op = { .type = KW_SPECIFIER, .test = Set_T, .set = Set_T|Set_Int, + .class = CInt, }; static struct symbol_op double_op = { @@ -275,6 +276,7 @@ static struct symbol_op short_op = { .type = KW_SPECIFIER | KW_SHORT, .test = Set_S|Set_Char|Set_Float|Set_Double|Set_Long|Set_Short, .set = Set_Short, + .class = CInt, }; static struct symbol_op signed_op = { @@ -301,6 +303,7 @@ static struct symbol_op int128_op = { .type = KW_SPECIFIER | KW_LONG, .test = Set_S|Set_T|Set_Char|Set_Short|Set_Int|Set_Float|Set_Double|Set_Long|Set_Vlong|Set_Int128, .set = Set_T|Set_Int128, + .class = CInt, }; static struct symbol_op if_op = { From patchwork Mon Nov 11 13:47:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237021 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8890B17E6 for ; Mon, 11 Nov 2019 13:47:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6732F206A3 for ; Mon, 11 Nov 2019 13:47:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WudQ4AFo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727073AbfKKNr7 (ORCPT ); Mon, 11 Nov 2019 08:47:59 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:39102 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbfKKNr6 (ORCPT ); Mon, 11 Nov 2019 08:47:58 -0500 Received: by mail-wr1-f66.google.com with SMTP id l7so3127572wrp.6 for ; Mon, 11 Nov 2019 05:47:56 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=VX4/TZfFPAlgzUu5ZuJ5Nh+yw64iDGlsNoT1o9oARQc=; b=WudQ4AFojtsfG9EuvYW2JUWeULL0fRKWK85T7naDkdjVn2ypuAr/YOthPG7BTOyYLA yzzQaFYcCXN0QFYfP4Y5geSH/2R1om8yOijmAMNLNrmfmYu/tW8MH1mcqCeNBz0RPt/2 JvqkIj+4fQ09qC/WJw+rSvpR6G6WwjX/x0v0QBG/Q6nZPv5vUGnghoEZFD+Bg95rM4VO 8QCkC2Rn+af7QV6uXSTrsJzomnfpHwjqwcOFT7Df1k1piOUNxfxZdB4URZXTdSdVkwJ0 e0oAtTCBPFM7pqxm64I8CMslSbGLaAfR4gInpqdaywGPV9Pd7Umb9SCc5ZxfV3l2KhGZ Xzqg== 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:mime-version:content-transfer-encoding; bh=VX4/TZfFPAlgzUu5ZuJ5Nh+yw64iDGlsNoT1o9oARQc=; b=SHarK3q5j1fBVbAzzDw+eU3mVK8K7Mt/ENV9+WH3l7+jIGwdG1lmZAxHAdJrfMMky0 qe7EmaYKW9SCrCBpIJb6iXIWvb+WVB/J64kq2hik4aS04XYwEt646j+s6o6w5N/CDNGM i1SSR3IXxXH1cNo3U+GACeqx5fUjOgfaI2f+TbJtWS598uL1ualWmXW3VV2DPvAQIZQ1 K0ysjmCSuPFc4l4XzGPntjU+h62Jnnj3623KWQoI78XH7dpzO2TmvqSSTyABZGjTSIN9 /x6dLJHk2BAiEbnTu+yqxMBVxB4Fsmyj099Zp2j6REPttVQgWq2O3LL0nEbUxgeyYkzk AWGA== X-Gm-Message-State: APjAAAXa+8vWteYvnf7KlIvxPXODe5+GKrZ0eSt4vgPzuYLe65USW6Tm aJn5GQLAaB4oEvCFrCNQfVj10cOA X-Google-Smtp-Source: APXvYqzMLfy/J9O8AazSz8Fme1jscj+0nOcFxwzIfvQR0AJQwKT1/LMFD9KzaC+ZCqaHjFVRUdwAFQ== X-Received: by 2002:a5d:458d:: with SMTP id p13mr20761732wrq.181.1573480075400; Mon, 11 Nov 2019 05:47:55 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:54 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 4/9] spec: improve parsing of __int128 Date: Mon, 11 Nov 2019 14:47:42 +0100 Message-Id: <20191111134747.79516-5-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org __int128 is processed as-if 'long' is applied to a 'long long'-like type. But this is not necessary or desirable: better to be more direct and process it as a kind of 'long long long' type. Signed-off-by: Luc Van Oostenryck --- parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.c b/parse.c index 797b3971e..c71f34a39 100644 --- a/parse.c +++ b/parse.c @@ -300,9 +300,9 @@ static struct symbol_op long_op = { }; static struct symbol_op int128_op = { - .type = KW_SPECIFIER | KW_LONG, + .type = KW_SPECIFIER, .test = Set_S|Set_T|Set_Char|Set_Short|Set_Int|Set_Float|Set_Double|Set_Long|Set_Vlong|Set_Int128, - .set = Set_T|Set_Int128, + .set = Set_T|Set_Int128|Set_Vlong, .class = CInt, }; @@ -1624,12 +1624,12 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta } seen |= s->op->set; class += s->op->class; - if (s->op->set & Set_Int128) - size = 2; if (s->op->type & KW_SHORT) { size = -1; } else if (s->op->set & Set_Char) { size = -2; + } else if (s->op->set & Set_Int128) { + size = 3; } else if (s->op->type & KW_LONG && size++) { if (class == CReal) { specifier_conflict(token->pos, From patchwork Mon Nov 11 13:47:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237031 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0A3EF1515 for ; Mon, 11 Nov 2019 13:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DD70C206A3 for ; Mon, 11 Nov 2019 13:48:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Yphl4cMo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727047AbfKKNsE (ORCPT ); Mon, 11 Nov 2019 08:48:04 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35115 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726970AbfKKNr7 (ORCPT ); Mon, 11 Nov 2019 08:47:59 -0500 Received: by mail-wr1-f67.google.com with SMTP id s5so3618502wrw.2 for ; Mon, 11 Nov 2019 05:47:57 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=oAD7nJkcojlVEh/iOs29rblOin1qKm/mis780XOEnAE=; b=Yphl4cMo8ATjiMS+/pCEzRq4VWkfRstcKsmzTvNbbJDQJ8MrX8lRXJuMiqSB0YSIyw c010Aii5/6leMQK52G82VZ2rKmdw46TK58ApLVpICgZTfR3aEJqLjBBJf+iJiig1wQP2 +6WwLtbi35T/aF1pkhI+dbVWYVZQlDv4+Z9Au2wh9DmWeZG9aOIhG1VtxOM1GAokhp/v fdT8vRQDX+F6iMjQbA416HFCsgG7aQUc7L2HWNazJrInP5v+hMP6gSI+XWZjpiCHHffo z8QJoYcW/1P/Ldp+BxdgadD+LaAApyHjvkv1HIwlkNnQHpmqSvutW+gz6IymXLwhl82n dP+Q== 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:mime-version:content-transfer-encoding; bh=oAD7nJkcojlVEh/iOs29rblOin1qKm/mis780XOEnAE=; b=JCczp7W0x+V99x0MJrgyOqDgE3VaLIUEjzhCgekB/X6BVhfAI8FklB6VtF6/JLk8Ag RfnG3KTMBCmuFQZTt63xNW0pUJGi1j8irmAFW6sF7whL+3j88KZMFLKrcZO5Cu3RAtJh H8SaacupN55YFS28Ifckz/X6GuMl2ev75Y2VH+UpuhQYkrolqwkRf+qw4g+blMf9sg4z hNAKHGZqTjqAeQ1iK0MCdEbFlPAjs3AOWtXyQr6ISzLBiQTi5QBRdMoLwQ8aloc05V4y /aKoNdteGLiMQeoQeih22y04O/Us5X5mvjsbrB0LZT3/+uhir2IFd0i4qUaJ4LHh80xQ 39rA== X-Gm-Message-State: APjAAAXKsyEajUXO8F71dyVVXjJjoanK+z82VQg+IMQQfUvB5p8ZhvZY 3BDHyqL0PAQwhjEgurrFm1tORAvA X-Google-Smtp-Source: APXvYqyUYHBf8Le9A1ZJ5tFmc/sHEEgWgq24sjj9GLfUCxPXkeOJcGYCv5vZc8GPX6BvURVM+9hjVg== X-Received: by 2002:a5d:6203:: with SMTP id y3mr4504581wru.142.1573480076181; Mon, 11 Nov 2019 05:47:56 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:55 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 5/9] spec: KW_SHORT is not needed Date: Mon, 11 Nov 2019 14:47:43 +0100 Message-Id: <20191111134747.79516-6-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org To determine the rank of shorts & floats, the keyword type KW_SHORT is used but there is no need for a specific keyword since testing for 'Set_Short' or 'Set_Float' has the same effect. So, remove this keyword and test the Set_... flags instead as this somehow clarify the processing of specifiers. Signed-off-by: Luc Van Oostenryck --- parse.c | 6 +++--- symbol.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.c b/parse.c index c71f34a39..3526bf37e 100644 --- a/parse.c +++ b/parse.c @@ -266,14 +266,14 @@ static struct symbol_op double_op = { }; static struct symbol_op float_op = { - .type = KW_SPECIFIER | KW_SHORT, + .type = KW_SPECIFIER, .test = Set_T|Set_Signed|Set_Unsigned|Set_Short|Set_Long, .set = Set_T|Set_Float, .class = CReal, }; static struct symbol_op short_op = { - .type = KW_SPECIFIER | KW_SHORT, + .type = KW_SPECIFIER, .test = Set_S|Set_Char|Set_Float|Set_Double|Set_Long|Set_Short, .set = Set_Short, .class = CInt, @@ -1624,7 +1624,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta } seen |= s->op->set; class += s->op->class; - if (s->op->type & KW_SHORT) { + if (s->op->set & (Set_Short|Set_Float)) { size = -1; } else if (s->op->set & Set_Char) { size = -2; diff --git a/symbol.h b/symbol.h index 4e7e437bf..5b25c040c 100644 --- a/symbol.h +++ b/symbol.h @@ -81,7 +81,7 @@ enum keyword { // KW UNUSED = 1 << 4, KW_ASM = 1 << 5, KW_MODE = 1 << 6, - KW_SHORT = 1 << 7, + // KW UNUSED = 1 << 7, KW_LONG = 1 << 8, KW_EXACT = 1 << 9, }; From patchwork Mon Nov 11 13:47:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237029 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D153017E6 for ; Mon, 11 Nov 2019 13:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B05A0206A3 for ; Mon, 11 Nov 2019 13:48:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KeR0Kzbz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbfKKNr7 (ORCPT ); Mon, 11 Nov 2019 08:47:59 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35877 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726832AbfKKNr7 (ORCPT ); Mon, 11 Nov 2019 08:47:59 -0500 Received: by mail-wm1-f65.google.com with SMTP id c22so13296657wmd.1 for ; Mon, 11 Nov 2019 05:47:57 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=CdpRZpXwwwpv+t6qLwk4W4YLQ/jTu158pXgTDvvwZT4=; b=KeR0KzbzvOZmqAYpMc3+k3kzqzypLMGfISBXy4er5SXu7i2mAoaseL4EFiPQOIScsv kn0w+T7Kf4lcerGmGAJf1IkE8pV0RZs1VqtfZ/UvcI0CZWjtHmBcxtIWsvliPWabWZjn 2k38C24soMvOjWqnrraB4/1JEtFPS6p5PScmYB9Z1jgk1n0GXmHb8cCCuRf5EZtYyA1J XpBHc8MDiZn4vSXWcacWeT7x+nE8cSxkiP9FKaUBaq4FmHl6Ffdct5acKqLQTLX41Tku 5ZNuugqOTyDgjMq/vTCf3+AiQ7rEizZq0jeS4nz0ofTmqzJ6Q8MtFzpUS4i84USiOaGQ JIlg== 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:mime-version:content-transfer-encoding; bh=CdpRZpXwwwpv+t6qLwk4W4YLQ/jTu158pXgTDvvwZT4=; b=lQ7XWTwZZ7+1fUQR+yt1V2ZujiFkdS5K3HHFQcPOzY6+MzlYT5nmnOZBPBu7BOxYuj zHhxRNP3NhvNFXhj9u78Hcr1YFYzNAeEJRQ/F/yBWTydnOSirMeMECJbg20HOW+9EErM lI4zU4HMki4cImiE1jRn2bRbqEYtkPsF0Qfk6JGm/w9Ff8yMZyQQ9/jj69ZlF1YEaNam SCCkdCRZCXxmaJuBpmjbHg22cpXzkddJOXC5J7FiZSAqMvEycJUVOB3W3BOJbNs1XFbH kAFiBog21MuQ/wOBz8vtZeSnFGm7iRubfuvJXfZ63oGMac5MPoczeX7owDuxdb/kxBZx x0og== X-Gm-Message-State: APjAAAXjr861L5chCQZd4OSaKQJm69zlgfIjrpD0+5yY7n386F7SWlIP z/A+o9DDZ2oeKhbv9MuBulqohY+p X-Google-Smtp-Source: APXvYqxHwXp1g/dJS06F2sSq3RuiwKjxsuufTHtL74E3pP7vbq6hT3/lO5UpbaekdZiXKPzkq+/d+w== X-Received: by 2002:a1c:998f:: with SMTP id b137mr21476111wme.104.1573480076913; Mon, 11 Nov 2019 05:47:56 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:56 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 6/9] spec: KW_LONG is not needed Date: Mon, 11 Nov 2019 14:47:44 +0100 Message-Id: <20191111134747.79516-7-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org To determine the rank of shorts & floats, the keyword type KW_LONG is used but there is no need for a specific keyword since testing for 'Set_Long' has the same effect. So, remove this keyword and test for 'Set_Long' instead as this somehow clarify the processing of specifiers. Signed-off-by: Luc Van Oostenryck --- parse.c | 4 ++-- symbol.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/parse.c b/parse.c index 3526bf37e..0ace13514 100644 --- a/parse.c +++ b/parse.c @@ -294,7 +294,7 @@ static struct symbol_op unsigned_op = { }; static struct symbol_op long_op = { - .type = KW_SPECIFIER | KW_LONG, + .type = KW_SPECIFIER, .test = Set_S|Set_Char|Set_Float|Set_Short|Set_Vlong, .set = Set_Long, }; @@ -1630,7 +1630,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta size = -2; } else if (s->op->set & Set_Int128) { size = 3; - } else if (s->op->type & KW_LONG && size++) { + } else if (s->op->set & Set_Long && size++) { if (class == CReal) { specifier_conflict(token->pos, Set_Vlong, diff --git a/symbol.h b/symbol.h index 5b25c040c..188291cd7 100644 --- a/symbol.h +++ b/symbol.h @@ -82,7 +82,7 @@ enum keyword { KW_ASM = 1 << 5, KW_MODE = 1 << 6, // KW UNUSED = 1 << 7, - KW_LONG = 1 << 8, + // KW UNUSED = 1 << 8, KW_EXACT = 1 << 9, }; From patchwork Mon Nov 11 13:47:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D636B1515 for ; Mon, 11 Nov 2019 13:48:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4C44206A3 for ; Mon, 11 Nov 2019 13:48:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="r/bJJv+c" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727053AbfKKNsB (ORCPT ); Mon, 11 Nov 2019 08:48:01 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43657 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727047AbfKKNsA (ORCPT ); Mon, 11 Nov 2019 08:48:00 -0500 Received: by mail-wr1-f68.google.com with SMTP id n1so14671134wra.10 for ; Mon, 11 Nov 2019 05:47:58 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=mZXNXY+6xe415JuXFu6oaGeh2uXAmJtbbPwMOJ1hcw4=; b=r/bJJv+cSy8teaSnCaoo3RNVpCI10kKZBDlMOwAH9A+HA0vhKsZcLZsY5v+6UP1ibC IjwCSqXCSLxr3qXISWaaCVQYZpkSutDDUXGsFH6axrFRpwp73xi1jbnmTuRsPpw47PQP uR93B93iAeWYb0ukP3sTHrtXxT66XzFzJYD2lHv0ZbbQaF8Q2pmgp86+mL+GiDVd4LEK JwTD/iO8ike9jbqMmFK1w/S58qkNtxPL4D2fGcVheH5IDuJiwgpRIFQrT9+4oplLlGxY xILnwhhKfpc2IMNSTlzCetva8Tdtjfavs/L9HlimNVNqo8CsiK+XLnAUm4b/5Y6V/C6b jOPg== 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:mime-version:content-transfer-encoding; bh=mZXNXY+6xe415JuXFu6oaGeh2uXAmJtbbPwMOJ1hcw4=; b=UvbE+Eojn1xUAI4Ex0eZwYqNLqBoHuw73d/bzxvMoJ8kWWZuMTHXVOjQ1t5CyWl/wy ts/2VXWUglOLtzh3Hjh6dVj8d+C2v0oPwirDxXy3K71cm2fMkZu6aoWhFGVyMTHffl7F oLg+tlMO0L4G4elYRwP2hhmrQOR6+LZNsn0hkXOPg6yukL06cczCTBW4kcser+ItCfNn YInqzQmwxVoK9NbobFSzkb7uST5m3jqk9z/8HRo6Qb8KZ9ii2JBgJPWPySL28Rk4iYs0 +LwePIs52w/HbMYj+ODC0vsvmTt2dMV4WY1OK6yA9vaS9/1MMiFw0Ec25fH+Ilh9kJFv eggw== X-Gm-Message-State: APjAAAX0VEO6RrXyNhW/JvzG2+4GIwog2rOLIQmfhWmDvGhXemAvPzg/ 70ERkLtwZHahwOQ3q+VAaxKJ3Eut X-Google-Smtp-Source: APXvYqzq8VTdBBxKi+MkmbnxOry5PH5Kvte3tcxBg4rdNgDqAj/Odxr2F2dMXHCAgu1hTShqP7dvZg== X-Received: by 2002:a5d:6944:: with SMTP id r4mr20092110wrw.238.1573480077974; Mon, 11 Nov 2019 05:47:57 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:57 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 7/9] spec: s/size/rank/ Date: Mon, 11 Nov 2019 14:47:45 +0100 Message-Id: <20191111134747.79516-8-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org In declaration_specifiers() the variable 'size' is used to make the distinction between char/short/int/long/long long/... but this correspond more closely to the notion of 'rank' since some of these types can have the same bit-size. Rename the variable 'size' to 'rank'. Signed-off-by: Luc Van Oostenryck --- parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/parse.c b/parse.c index 0ace13514..46136ec66 100644 --- a/parse.c +++ b/parse.c @@ -1599,7 +1599,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta { int seen = 0; int class = CInt; - int size = 0; + int rank = 0; while (token_type(token) == TOKEN_IDENT) { struct symbol *s = lookup_symbol(token->ident, @@ -1625,12 +1625,12 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta seen |= s->op->set; class += s->op->class; if (s->op->set & (Set_Short|Set_Float)) { - size = -1; + rank = -1; } else if (s->op->set & Set_Char) { - size = -2; + rank = -2; } else if (s->op->set & Set_Int128) { - size = 3; - } else if (s->op->set & Set_Long && size++) { + rank = 3; + } else if (s->op->set & Set_Long && rank++) { if (class == CReal) { specifier_conflict(token->pos, Set_Vlong, @@ -1652,7 +1652,7 @@ static struct token *declaration_specifiers(struct token *token, struct decl_sta if (!(seen & Set_S)) { /* not set explicitly? */ struct symbol *base = &incomplete_ctype; if (seen & Set_Any) - base = types[class][size]; + base = types[class][rank]; ctx->ctype.base_type = base; } From patchwork Mon Nov 11 13:47:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237023 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AB1C1515 for ; Mon, 11 Nov 2019 13:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5F443206A3 for ; Mon, 11 Nov 2019 13:48:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jX6ONkEI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbfKKNsB (ORCPT ); Mon, 11 Nov 2019 08:48:01 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50783 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfKKNsA (ORCPT ); Mon, 11 Nov 2019 08:48:00 -0500 Received: by mail-wm1-f67.google.com with SMTP id l17so12591370wmh.0 for ; Mon, 11 Nov 2019 05:47:59 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=yv6AnQIr2AbJ5TC1yXbtGHvaFQBFGMuEA59a53Ejk4g=; b=jX6ONkEIqzaKi1ilpruWI+Dc98I6Y3MH56uCaT7dFpMtQFJeC7plmD2t7IVJRYpkf9 VOcPS3Z1yHex9/VJmHof6UJUF4vaTUpsEdBU7hgDqIp4/G2T897ielccuGKX+2g9Hev0 aUjY3e/rtGsB84iAt+MXjPRvXc5sG6yB7L7poHQNzet8NtECeEZc/9p5g7pkm1DCk1ll Zek6qkeufSIFqwpB6B2puGi0vf6DMSNHUTm2x0dhUdbzI+RINvFKe0oBqQd/sSdSigNa 2iOVI6dc3Z5IoTEcxyN1ySgvIbn1tMxp4NRZAtv791M/23VsbsCcBWM/4Q9vNc4NTHuf MH2w== 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:mime-version:content-transfer-encoding; bh=yv6AnQIr2AbJ5TC1yXbtGHvaFQBFGMuEA59a53Ejk4g=; b=r83Hva8gyrURrgJQKmTfG8e/FjNMYNZ7jOrpXkFdJ25Xe1xHhZe45ATn5ucSysyVGf zIIUtDseEvITMnEx/v+MR8pC8IMXEDSj5Wgn6RjVGfA+JkEo653furDQmFk16ibEBzoh 6GupEHkrfb6ZJTj47yXrqtVR6dCeg7aIAhBt/y9FAuazI+stbJKhurJ9QIZV7QzDLhpw Uf1Smrv4XYrT2JFkAkFKu0bU8TL0KnJftmTyoLqEQik4Xj+phdN1EmvrDp4u6U62DChl bqTjvp+bohTToiqV2YKKLkz//h2FRdP4k3toh4l4QRqC8OnKhtsBZor0OAt3fVhME/QO Tjxw== X-Gm-Message-State: APjAAAW6WHIsTb9Cywr9TOIoZ2Yy5lI4xKR/mnoVKqy4qJW0qiCY0CfU y37pW1iNCrLjnhEfxLPnzUEvTWgT X-Google-Smtp-Source: APXvYqzNwOWguTy2Y0waOD+TJzQQCqEW7CzuTFp0o9E2uEgxQGtHy67ONfCCMPQmsK54UE65q5Y+bg== X-Received: by 2002:a1c:1b06:: with SMTP id b6mr20003619wmb.3.1573480078829; Mon, 11 Nov 2019 05:47:58 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:58 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 8/9] types: use llong instead of longlong, ldouble for ... Date: Mon, 11 Nov 2019 14:47:46 +0100 Message-Id: <20191111134747.79516-9-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org These shortened names are used elsewhere too but the may reason for the change is to try to make ctype_declare[] more readable. Signed-off-by: Luc Van Oostenryck --- expression.c | 2 +- lib.c | 2 +- symbol.c | 16 ++++++++-------- target.c | 10 +++++----- target.h | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/expression.c b/expression.c index ffb6cb9dc..e1720f194 100644 --- a/expression.c +++ b/expression.c @@ -325,7 +325,7 @@ static void get_number_value(struct expression *expr, struct token *token) size = 2; do_warn |= 1; } - bits = bits_in_longlong - 1; + bits = bits_in_llong - 1; if (value & (~1ULL << bits)) goto Eoverflow; if (!(value & (1ULL << bits))) diff --git a/lib.c b/lib.c index fd45da5d1..74a01a83c 100644 --- a/lib.c +++ b/lib.c @@ -1443,7 +1443,7 @@ static void predefined_macros(void) predefined_sizeof("FLOAT", "", bits_in_float); predefined_sizeof("DOUBLE", "", bits_in_double); - predefined_sizeof("LONG_DOUBLE", "", bits_in_longdouble); + predefined_sizeof("LONG_DOUBLE", "", bits_in_ldouble); predefine("__ORDER_LITTLE_ENDIAN__", 1, "1234"); predefine("__ORDER_BIG_ENDIAN__", 1, "4321"); diff --git a/symbol.c b/symbol.c index 90149e5ae..a7cbe08b4 100644 --- a/symbol.c +++ b/symbol.c @@ -759,21 +759,21 @@ static const struct ctype_declare { { &long_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, { &slong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, { &ulong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, - { &llong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LL, &bits_in_longlong, &max_int_alignment, &int_type }, - { &sllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LL, &bits_in_longlong, &max_int_alignment, &int_type }, - { &ullong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LL, &bits_in_longlong, &max_int_alignment, &int_type }, - { &lllong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LLL, &bits_in_longlonglong, &max_int_alignment, &int_type }, - { &slllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LLL, &bits_in_longlonglong, &max_int_alignment, &int_type }, - { &ulllong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LLL, &bits_in_longlonglong, &max_int_alignment, &int_type }, + { &llong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, + { &sllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, + { &ullong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, + { &lllong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, + { &slllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, + { &ulllong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, { &float_ctype, SYM_BASETYPE, 0, &bits_in_float, &max_fp_alignment, &fp_type }, { &double_ctype, SYM_BASETYPE, MOD_LONG, &bits_in_double, &max_fp_alignment, &fp_type }, - { &ldouble_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_longdouble, &max_fp_alignment, &fp_type }, + { &ldouble_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_ldouble, &max_fp_alignment, &fp_type }, { &float32_ctype, SYM_BASETYPE, 0, &bits_in_type32, &max_fp_alignment, &fp_type }, { &float32x_ctype, SYM_BASETYPE, MOD_LONG, &bits_in_double, &max_fp_alignment, &fp_type }, { &float64_ctype, SYM_BASETYPE, 0, &bits_in_type64, &max_fp_alignment, &fp_type }, - { &float64x_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_longdouble, &max_fp_alignment, &fp_type }, + { &float64x_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_ldouble, &max_fp_alignment, &fp_type }, { &float128_ctype, SYM_BASETYPE, 0, &bits_in_type128, &max_alignment, &fp_type }, { &string_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &char_ctype }, diff --git a/target.c b/target.c index 90097818f..4ec736258 100644 --- a/target.c +++ b/target.c @@ -28,8 +28,8 @@ int bits_in_char = 8; int bits_in_short = 16; int bits_in_int = 32; int bits_in_long = 32; -int bits_in_longlong = 64; -int bits_in_longlonglong = 128; +int bits_in_llong = 64; +int bits_in_lllong = 128; int max_int_alignment = 4; @@ -38,7 +38,7 @@ int max_int_alignment = 4; */ int bits_in_float = 32; int bits_in_double = 64; -int bits_in_longdouble = 128; +int bits_in_ldouble = 128; int max_fp_alignment = 16; @@ -121,7 +121,7 @@ void init_target(void) case MACH_S390: case MACH_S390X: case MACH_SPARC32: - bits_in_longdouble = 64; + bits_in_ldouble = 64; max_fp_alignment = 8; break; case MACH_X86_64: @@ -130,7 +130,7 @@ void init_target(void) /* fall through */ case MACH_I386: case MACH_M68K: - bits_in_longdouble = 96; + bits_in_ldouble = 96; max_fp_alignment = 4; break; default: diff --git a/target.h b/target.h index 8bbe494f8..36e7610a0 100644 --- a/target.h +++ b/target.h @@ -25,8 +25,8 @@ extern int bits_in_char; extern int bits_in_short; extern int bits_in_int; extern int bits_in_long; -extern int bits_in_longlong; -extern int bits_in_longlonglong; +extern int bits_in_llong; +extern int bits_in_lllong; extern int max_int_alignment; @@ -35,7 +35,7 @@ extern int max_int_alignment; */ extern int bits_in_float; extern int bits_in_double; -extern int bits_in_longdouble; +extern int bits_in_ldouble; extern int max_fp_alignment; From patchwork Mon Nov 11 13:47:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 11237027 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6A4F159A for ; Mon, 11 Nov 2019 13:48:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 714D3206A3 for ; Mon, 11 Nov 2019 13:48:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rwzTkYEk" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbfKKNsD (ORCPT ); Mon, 11 Nov 2019 08:48:03 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41340 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727121AbfKKNsB (ORCPT ); Mon, 11 Nov 2019 08:48:01 -0500 Received: by mail-wr1-f67.google.com with SMTP id p4so14695124wrm.8 for ; Mon, 11 Nov 2019 05:48:00 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=1eMwrBna0llc9tyi8DkD9f4Iu/JvMA18j4Z7XZ5ahqk=; b=rwzTkYEkFLesK1v5wtAxAR0Gly+cv6u5o5t/Lmg6KxaauesOuTqdExzrRE9UZ6kwcL 7wnDXNMms7ipYHSRoLz8o5HlBmwFRvHYGOGCfcKXElv3zzp42eVcSPX2eZhJp4UfWSjT 1XeIjRYKnn1N7RUq/BRvkrUlVIsceEzya4oAEOdWHCl1k9pD3AuoBuqFARehTmFzdTzk lV0YLT+nYrjQTvDztMCe12jvMt4vKR1MYkkYP5dBko9XHbnmpEXaKMCfELpOupVyzayN lhVPgzdrefpIOI8lcPGu4bEJFzWnz8oi5p5YVoSihJO+vPOJQNiJllXJG0EtOM1nXhKR deMg== 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:mime-version:content-transfer-encoding; bh=1eMwrBna0llc9tyi8DkD9f4Iu/JvMA18j4Z7XZ5ahqk=; b=J3qTvlxjmfGhC95GxMv/9JKwG1c3dwxe+Rk+0OxU6G29BtLcO5j8TKJQSCqwlOTQfD BakVcQF/056snnROrTK1RKl1KEDyPf5NiBG7YFkeVIha3zFfK42WHTQu/fKlQk8l8nqX SCuda+yOAiv/R3cHQ2Q9Jw3oy0DhR+0+JiAbtwoVoyq2RHjWiMxHo9qTV3o5pGNJsUDX X+LHOCTRtG+lr7M3yE3ASAvqJxkWSjJfIAABwgJ79zLzPT+q6NcckXkeT+bj4G0aHqwa oinhNO2uRZ2oKKcKGHpKh7nqnG+Mm6XVWyFrVyh3L75bJrtyRVzn+2Grnt3AD2ptP669 EOVA== X-Gm-Message-State: APjAAAXtMyMYX4SfHPSka9dmabfvEBmO1iTO6ZAWkXXRXZOhMofkkNDc AT/CF/58NM+7iausiYIGPBvXCG/5 X-Google-Smtp-Source: APXvYqybdRVLSi90DoQ8D+eoHSfANtUYa3o6D3WcB3Z9WOFaQd2N8GaGabnlxR4myhMqxkI96eTQkQ== X-Received: by 2002:adf:cf0c:: with SMTP id o12mr8028209wrj.102.1573480079827; Mon, 11 Nov 2019 05:47:59 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:4058:bc00:7107:cc84:c820:8cf8]) by smtp.gmail.com with ESMTPSA id u187sm18384031wme.15.2019.11.11.05.47.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 05:47:59 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Luc Van Oostenryck Subject: [PATCH 9/9] spec: make ctype_declare[] more readable Date: Mon, 11 Nov 2019 14:47:47 +0100 Message-Id: <20191111134747.79516-10-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> References: <20191111134747.79516-1-luc.vanoostenryck@gmail.com> MIME-Version: 1.0 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org The table ctype_declare[] is used to initialize the builtin types. It contains quite a bit information and is thus quite large and is difficult to read. Fix this by using some macros to abstract the specificities of the different kind of types, making the table narrower and much more readable. Signed-off-by: Luc Van Oostenryck --- symbol.c | 114 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 51 deletions(-) diff --git a/symbol.c b/symbol.c index a7cbe08b4..c032d6d90 100644 --- a/symbol.c +++ b/symbol.c @@ -733,6 +733,18 @@ static int bits_in_type128 = 128; #define MOD_ESIGNED (MOD_SIGNED | MOD_EXPLICITLY_SIGNED) #define MOD_LL (MOD_LONG | MOD_LONGLONG) #define MOD_LLL MOD_LONGLONGLONG + +#define T_BASETYPE SYM_BASETYPE, 0, NULL, NULL, NULL +#define T_INT(R, S, M) SYM_BASETYPE, (R|M), &bits_in_##S, &max_int_alignment, &int_type +#define T__INT(R, S) T_INT(R, S, MOD_SIGNED) +#define T_SINT(R, S) T_INT(R, S, MOD_ESIGNED) +#define T_UINT(R, S) T_INT(R, S, MOD_UNSIGNED) +#define T_FLOAT_(R,S,A) SYM_BASETYPE, R, &bits_in_##S, A, &fp_type +#define T_FLOAT(R, S) T_FLOAT_(R, S, &max_fp_alignment) +#define T_PTR(B) SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, B +#define T_NODE(M,B,S,A) SYM_NODE, M, S, A, B +#define T_CONST(B,S,A) T_NODE(MOD_CONST, B, S, A) + static const struct ctype_declare { struct symbol *ptr; enum type type; @@ -741,57 +753,57 @@ static const struct ctype_declare { int *maxalign; struct symbol *base_type; } ctype_declaration[] = { - { &bool_ctype, SYM_BASETYPE, MOD_UNSIGNED, &bits_in_bool, &max_int_alignment, &int_type }, - { &void_ctype, SYM_BASETYPE, 0, NULL, NULL, NULL }, - { &type_ctype, SYM_BASETYPE, 0, NULL, NULL, NULL }, - { &incomplete_ctype,SYM_BASETYPE, 0, NULL, NULL, NULL }, - { &bad_ctype, SYM_BASETYPE, 0, NULL, NULL, NULL }, - - { &char_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_CHAR, &bits_in_char, &max_int_alignment, &int_type }, - { &schar_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_CHAR, &bits_in_char, &max_int_alignment, &int_type }, - { &uchar_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_CHAR, &bits_in_char, &max_int_alignment, &int_type }, - { &short_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_SHORT, &bits_in_short, &max_int_alignment, &int_type }, - { &sshort_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_SHORT, &bits_in_short, &max_int_alignment, &int_type }, - { &ushort_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_SHORT, &bits_in_short, &max_int_alignment, &int_type }, - { &int_ctype, SYM_BASETYPE, MOD_SIGNED, &bits_in_int, &max_int_alignment, &int_type }, - { &sint_ctype, SYM_BASETYPE, MOD_ESIGNED, &bits_in_int, &max_int_alignment, &int_type }, - { &uint_ctype, SYM_BASETYPE, MOD_UNSIGNED, &bits_in_int, &max_int_alignment, &int_type }, - { &long_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, - { &slong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, - { &ulong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LONG, &bits_in_long, &max_int_alignment, &int_type }, - { &llong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, - { &sllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, - { &ullong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LL, &bits_in_llong, &max_int_alignment, &int_type }, - { &lllong_ctype, SYM_BASETYPE, MOD_SIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, - { &slllong_ctype, SYM_BASETYPE, MOD_ESIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, - { &ulllong_ctype, SYM_BASETYPE, MOD_UNSIGNED | MOD_LLL, &bits_in_lllong, &max_int_alignment, &int_type }, - - { &float_ctype, SYM_BASETYPE, 0, &bits_in_float, &max_fp_alignment, &fp_type }, - { &double_ctype, SYM_BASETYPE, MOD_LONG, &bits_in_double, &max_fp_alignment, &fp_type }, - { &ldouble_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_ldouble, &max_fp_alignment, &fp_type }, - - { &float32_ctype, SYM_BASETYPE, 0, &bits_in_type32, &max_fp_alignment, &fp_type }, - { &float32x_ctype, SYM_BASETYPE, MOD_LONG, &bits_in_double, &max_fp_alignment, &fp_type }, - { &float64_ctype, SYM_BASETYPE, 0, &bits_in_type64, &max_fp_alignment, &fp_type }, - { &float64x_ctype, SYM_BASETYPE, MOD_LONG | MOD_LONGLONG, &bits_in_ldouble, &max_fp_alignment, &fp_type }, - { &float128_ctype, SYM_BASETYPE, 0, &bits_in_type128, &max_alignment, &fp_type }, - - { &string_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &char_ctype }, - { &ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, - { &null_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, - { &label_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, - { &lazy_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, - { &int_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &int_ctype }, - { &uint_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &uint_ctype }, - { &long_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &long_ctype }, - { &ulong_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &ulong_ctype }, - { &llong_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &llong_ctype }, - { &ullong_ptr_ctype,SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &ullong_ctype }, - - { &const_void_ctype, SYM_NODE, MOD_CONST, NULL, NULL, &void_ctype }, - { &const_char_ctype, SYM_NODE, MOD_CONST, &bits_in_char, &max_int_alignment, &char_ctype }, - { &const_ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &const_void_ctype }, - { &const_string_ctype,SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &const_char_ctype }, + { &bool_ctype, T_INT(0, bool, MOD_UNSIGNED) }, + { &void_ctype, T_BASETYPE }, + { &type_ctype, T_BASETYPE }, + { &incomplete_ctype, T_BASETYPE }, + { &bad_ctype, T_BASETYPE }, + + { &char_ctype, T__INT(MOD_CHAR, char) }, + { &schar_ctype, T_SINT(MOD_CHAR, char) }, + { &uchar_ctype, T_UINT(MOD_CHAR, char) }, + { &short_ctype, T__INT(MOD_SHORT, short) }, + { &sshort_ctype, T_SINT(MOD_SHORT, short) }, + { &ushort_ctype, T_UINT(MOD_SHORT, short) }, + { &int_ctype, T__INT(0, int) }, + { &sint_ctype, T_SINT(0, int) }, + { &uint_ctype, T_UINT(0, int) }, + { &long_ctype, T__INT(MOD_LONG, long) }, + { &slong_ctype, T_SINT(MOD_LONG, long) }, + { &ulong_ctype, T_UINT(MOD_LONG, long) }, + { &llong_ctype, T__INT(MOD_LL, llong) }, + { &sllong_ctype, T_SINT(MOD_LL, llong) }, + { &ullong_ctype, T_UINT(MOD_LL, llong) }, + { &lllong_ctype, T__INT(MOD_LLL, lllong) }, + { &slllong_ctype, T_SINT(MOD_LLL, lllong) }, + { &ulllong_ctype, T_UINT(MOD_LLL, lllong) }, + + { &float_ctype, T_FLOAT(0, float) }, + { &double_ctype, T_FLOAT(MOD_LONG, double) }, + { &ldouble_ctype, T_FLOAT(MOD_LL, ldouble) }, + + { &float32_ctype, T_FLOAT(0, type32) }, + { &float32x_ctype, T_FLOAT(MOD_LONG, double) }, + { &float64_ctype, T_FLOAT(MOD_LONG, type64) }, + { &float64x_ctype, T_FLOAT(MOD_LONG, ldouble) }, + { &float128_ctype, T_FLOAT_(MOD_LL, type128, &max_alignment) }, + + { &string_ctype, T_PTR(&char_ctype) }, + { &ptr_ctype, T_PTR(&void_ctype) }, + { &null_ctype, T_PTR(&void_ctype) }, + { &label_ctype, T_PTR(&void_ctype) }, + { &lazy_ptr_ctype, T_PTR(&void_ctype) }, + { &int_ptr_ctype, T_PTR(&int_ctype) }, + { &uint_ptr_ctype, T_PTR(&uint_ctype) }, + { &long_ptr_ctype, T_PTR(&long_ctype) }, + { &ulong_ptr_ctype, T_PTR(&ulong_ctype) }, + { &llong_ptr_ctype, T_PTR(&llong_ctype) }, + { &ullong_ptr_ctype, T_PTR(&ullong_ctype) }, + { &const_ptr_ctype, T_PTR(&const_void_ctype) }, + { &const_string_ctype, T_PTR(&const_char_ctype) }, + + { &const_void_ctype, T_CONST(&void_ctype, NULL, NULL) }, + { &const_char_ctype, T_CONST(&char_ctype, &bits_in_char, &max_int_alignment)}, { NULL, } }; #undef MOD_LLL