From patchwork Mon Oct 29 15:39:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Dooks X-Patchwork-Id: 10659443 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 E1A5D14BD for ; Mon, 29 Oct 2018 15:39:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEFA229AC7 for ; Mon, 29 Oct 2018 15:39:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3BB129AD7; Mon, 29 Oct 2018 15:39:57 +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=-7.9 required=2.0 tests=BAYES_00,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 F053829AD1 for ; Mon, 29 Oct 2018 15:39:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727520AbeJ3A3E (ORCPT ); Mon, 29 Oct 2018 20:29:04 -0400 Received: from imap1.codethink.co.uk ([176.9.8.82]:59234 "EHLO imap1.codethink.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727503AbeJ3A3D (ORCPT ); Mon, 29 Oct 2018 20:29:03 -0400 Received: from [148.252.241.226] (helo=rainbowdash) by imap1.codethink.co.uk with esmtpsa (Exim 4.84_2 #1 (Debian)) id 1gH9dx-0005vO-To; Mon, 29 Oct 2018 15:39:54 +0000 Received: from ben by rainbowdash with local (Exim 4.91) (envelope-from ) id 1gH9dx-0003eV-KL; Mon, 29 Oct 2018 15:39:53 +0000 From: Ben Dooks To: linux-sparse@vger.kernel.org Cc: Ben Dooks Subject: [PATCH 2/5] add ptr_ctype_noderef for use with prinft code Date: Mon, 29 Oct 2018 15:39:49 +0000 Message-Id: <20181029153952.13927-3-ben.dooks@codethink.co.uk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181029153952.13927-1-ben.dooks@codethink.co.uk> References: <20181029153952.13927-1-ben.dooks@codethink.co.uk> 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 Add a specific type for a pointer that shouldn't be dereferenced. This is used by the printf format parser for the %p case. Signed-off-by: Ben Dooks --- symbol.c | 4 +++- symbol.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/symbol.c b/symbol.c index 26906ec..b1e7db1 100644 --- a/symbol.c +++ b/symbol.c @@ -674,7 +674,8 @@ struct symbol bool_ctype, void_ctype, type_ctype, llong_ctype, sllong_ctype, ullong_ctype, lllong_ctype, slllong_ctype, ulllong_ctype, float_ctype, double_ctype, ldouble_ctype, - string_ctype, ptr_ctype, lazy_ptr_ctype, + string_ctype, + ptr_ctype, ptr_ctype_noderef, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, null_ctype; @@ -740,6 +741,7 @@ static const struct ctype_declare { { &string_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &char_ctype }, { &ptr_ctype, SYM_PTR, 0, &bits_in_pointer, &pointer_alignment, &void_ctype }, + { &ptr_ctype_noderef, SYM_PTR, MOD_NODEREF, &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 }, diff --git a/symbol.h b/symbol.h index 3274496..1f338f5 100644 --- a/symbol.h +++ b/symbol.h @@ -266,7 +266,7 @@ extern struct symbol bool_ctype, void_ctype, type_ctype, llong_ctype, sllong_ctype, ullong_ctype, lllong_ctype, slllong_ctype, ulllong_ctype, float_ctype, double_ctype, ldouble_ctype, - string_ctype, ptr_ctype, lazy_ptr_ctype, + string_ctype, ptr_ctype, ptr_ctype_noderef, lazy_ptr_ctype, incomplete_ctype, label_ctype, bad_ctype, null_ctype;