From patchwork Sun Dec 9 23:43:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 10720421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1C44D14E2 for ; Sun, 9 Dec 2018 23:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0263229DC1 for ; Sun, 9 Dec 2018 23:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7E1829DD5; Sun, 9 Dec 2018 23:43:30 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 8D4A129DC1 for ; Sun, 9 Dec 2018 23:43:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbeLIXn3 (ORCPT ); Sun, 9 Dec 2018 18:43:29 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:44117 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726375AbeLIXn3 (ORCPT ); Sun, 9 Dec 2018 18:43:29 -0500 Received: by mail-ed1-f67.google.com with SMTP id y56so7977544edd.11 for ; Sun, 09 Dec 2018 15:43:27 -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:mime-version :content-transfer-encoding; bh=g8KFngwpuAHVxmgrompJq8Y31RZ0GgDfagm8c6c50oI=; b=aAE3zOqIHCJ7dciQ2JQJyrNrZwIOHZiQFfiy1ralzeBf0jxG1ji8UONbB24V75iuL6 A9J2szzFM8V2Hdt3AA1xK5SufX5NKhLDuVFJ59xb757JB0IBaKJ84xSMM4djn3vAnome C2UggerUaQQpltJsobsVKY8QPfBCuGxon1dhGSRzbJ9jP1bJwfHDoR9vzt9lVRsZbJc9 ItA+BiyAuhx5ascBJtl4RJfqVERnSAYfohISAD3PzcW1Nit2WBEBkieqIXoZehbZ73mA QBmxEcGGxbtI+XPFmXIJ4RarIkiDpuMUkbTcxwzm0lCGCl0DTG2wGaZ0l2qzM2kHbs5a cEyA== 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:mime-version :content-transfer-encoding; bh=g8KFngwpuAHVxmgrompJq8Y31RZ0GgDfagm8c6c50oI=; b=UgAsnSPwAuspg6xmA23K5smtHHf9o9Hyo9g2D5Oz53E2OCQmcBQNffVZ8zXFBgctrS blnDnGXyplZ9ND5rTBHa3YaB+wxgcItiOOt+8OoB+tM1Z22Ee9RsWLT3N5ViYs0dG33D K1tOA4my0c4HoPKj/rtOw2vfdeChx5kTK08vzBJCfZ0bg7tGErVrrf7uul8pbvLG6lF0 tLx7hIvkrJEB2S3sRQqvp94AfU6dRmi8tKgzhwO+UtskWjnmbWtdIT9TNfO6pFy2dJed 6ORtBjvUJ1nySdWqqeTCYfn043Cs7PZ3Dv6NMjhHLAhexsT23pacDNPatf2ZnTx6RnM7 W1hQ== X-Gm-Message-State: AA+aEWat+7tHJRu3IH7h5zIb5oGZg79IGSv3Ch5J6Tx+gqlMi8wCRABb KvItdFvWae8GpJde7yb47ecbz26m X-Google-Smtp-Source: AFSGD/Wl7VTv8/+trvfHCPjbCWrPR/lbi4wfOgmqAAk0i/XmYwC/DodZrzzWpNYh4RS2JB2byTmJsQ== X-Received: by 2002:a50:b172:: with SMTP id l47mr9419006edd.225.1544399006866; Sun, 09 Dec 2018 15:43:26 -0800 (PST) Received: from localhost.localdomain ([2a02:a03f:40bc:4d00:e8b1:47b5:cae1:da95]) by smtp.gmail.com with ESMTPSA id z9sm2888225edr.61.2018.12.09.15.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 15:43:25 -0800 (PST) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Ramsay Jones , Luc Van Oostenryck Subject: [PATCH 00/11] predefined macros for intmax_t/intptr_t/... Date: Mon, 10 Dec 2018 00:43:09 +0100 Message-Id: <20181209234320.65274-1-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 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 Some types have already their TYPE/SIZEOF/MAX macros. These patches add them for the missing types: ptrdiff, int{ptr,max,64,32,16,8}_t and their unsigned version. Note: some of the types vary a lot depending on the architecture, OS & exact ABI used. This is specially the case for for int32_t. The definition in these patches should be correct for the most common archs & ABI used for the kernel but it can't possibly be correct for all cases. Luc Van Oostenryck (11): testsuite: test predef macros on LP32/LP64/LLP64 fix '__SIZE_TYPE__' for LLP64 allow optional "_T" suffix to __SIZEOF_XXX__ add builtin_type_suffix() make predefined_type_size() more generic give a type to wchar add predefined macros for [u]intptr & ptrdiff add predefined macros for [u]int_max add predefined macros for [u]int{8,16}_t add predefined macros for [u]int64_t add predefined macros for [u]int32_t char.c | 4 +- lib.c | 121 +++++++++++++++------- show-parse.c | 73 +++++++------ symbol.h | 1 + target.c | 9 +- target.h | 9 +- validation/preprocessor/predef-char-bit.c | 16 --- validation/preprocessor/predef-llp64.c | 9 ++ validation/preprocessor/predef-lp32.c | 9 ++ validation/preprocessor/predef-lp64.c | 9 ++ validation/preprocessor/predef-max.c | 18 ---- validation/preprocessor/predef-sizeof.c | 25 ----- validation/preprocessor/predef.c | 45 ++++++++ 13 files changed, 212 insertions(+), 136 deletions(-) delete mode 100644 validation/preprocessor/predef-char-bit.c create mode 100644 validation/preprocessor/predef-llp64.c create mode 100644 validation/preprocessor/predef-lp32.c create mode 100644 validation/preprocessor/predef-lp64.c delete mode 100644 validation/preprocessor/predef-max.c delete mode 100644 validation/preprocessor/predef-sizeof.c create mode 100644 validation/preprocessor/predef.c