From patchwork Mon Aug 4 18:33:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 4673091 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B6982C0338 for ; Mon, 4 Aug 2014 18:40:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9C432013D for ; Mon, 4 Aug 2014 18:40:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 26DCC200E8 for ; Mon, 4 Aug 2014 18:40:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751428AbaHDSkM (ORCPT ); Mon, 4 Aug 2014 14:40:12 -0400 Received: from mdfmta005.mxout.tbr.inty.net ([91.221.168.46]:36675 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751259AbaHDSkM (ORCPT ); Mon, 4 Aug 2014 14:40:12 -0400 Received: from smtp.demon.co.uk (unknown [127.0.0.1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mdfmta005.tbr.inty.net (Postfix) with ESMTP id 78CEDA64F9B for ; Mon, 4 Aug 2014 18:28:00 +0100 (BST) Received: from mdfmta009.tbr.inty.net (unknown [127.0.0.1]) by mdfmta009.tbr.inty.net (Postfix) with ESMTP id 46859384084; Mon, 4 Aug 2014 17:55:32 +0100 (BST) Received: from mdfmta009.tbr.inty.net (unknown [127.0.0.1]) by mdfmta009.tbr.inty.net (Postfix) with ESMTP id 178A8384081; Mon, 4 Aug 2014 17:55:32 +0100 (BST) Received: from [192.168.254.10] (unknown [80.176.147.220]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mdfmta009.tbr.inty.net (Postfix) with ESMTP; Mon, 4 Aug 2014 17:55:31 +0100 (BST) Message-ID: <53DFD206.20002@ramsay1.demon.co.uk> Date: Mon, 04 Aug 2014 19:33:42 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 02/10] sparse: add 'gnu_inline' to the ignored attributes X-MDF-HostID: 4 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add some more ignored attributes which are used in glibc header files, along with a simple test case which includes all three inline attributes (__gnu_inline__, __always_inline__ and __noinline__). Signed-off-by: Ramsay Jones --- parse.c | 2 ++ validation/attr-inline.c | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 validation/attr-inline.c diff --git a/parse.c b/parse.c index 9767e59..69bcf82 100644 --- a/parse.c +++ b/parse.c @@ -536,6 +536,8 @@ const char *ignored_attributes[] = { "__format__", "format_arg", "__format_arg__", + "gnu_inline", + "__gnu_inline__", "hot", "__hot__", "leaf", diff --git a/validation/attr-inline.c b/validation/attr-inline.c new file mode 100644 index 0000000..1b88ddb --- /dev/null +++ b/validation/attr-inline.c @@ -0,0 +1,21 @@ + +static inline __attribute__((__always_inline__)) int gt(int lhs, int rhs) +{ + return lhs > rhs; +} + +extern inline __attribute__((__gnu_inline__)) int ge(int lhs, int rhs) +{ + return lhs >= rhs; +} + +static __attribute__((__warning__("That's junk!"))) __attribute__((__unused__)) +__attribute__((__noinline__)) +void junk(void) +{ + __asm__(""); +} + +/* + * check-name: inline attributes + */