From patchwork Tue May 21 19:15:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramsay Jones X-Patchwork-Id: 2598861 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id E1BB840077 for ; Tue, 21 May 2013 19:28:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753022Ab3EUT2Q (ORCPT ); Tue, 21 May 2013 15:28:16 -0400 Received: from mdfmta005.mxout.tbr.inty.net ([91.221.168.46]:33954 "EHLO smtp.demon.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752887Ab3EUT2M (ORCPT ); Tue, 21 May 2013 15:28:12 -0400 Received: from mdfmta005.tbr.inty.net (unknown [127.0.0.1]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP id B2045A646F8; Tue, 21 May 2013 20:21:39 +0100 (BST) Received: from mdfmta005.tbr.inty.net (unknown [127.0.0.1]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP id EFE5AA646C3; Tue, 21 May 2013 20:21:38 +0100 (BST) Received: from [193.237.126.196] (unknown [193.237.126.196]) by mdfmta005.tbr.inty.net (Postfix) with ESMTP; Tue, 21 May 2013 20:21:38 +0100 (BST) Message-ID: <519BC7E0.7030403@ramsay1.demon.co.uk> Date: Tue, 21 May 2013 20:15:44 +0100 From: Ramsay Jones User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130328 Thunderbird/17.0.5 MIME-Version: 1.0 To: Christopher Li CC: Sparse Mailing-list Subject: [PATCH 1/5] Add the __restrict__ keyword X-MDF-HostID: 8 Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org Signed-off-by: Ramsay Jones --- ident-list.h | 2 +- parse.c | 3 ++- validation/reserved.c | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ident-list.h b/ident-list.h index e93aae7..78b4890 100644 --- a/ident-list.h +++ b/ident-list.h @@ -86,7 +86,7 @@ IDENT(stdcall); IDENT(__stdcall__); IDENT(fastcall); IDENT(__fastcall__); IDENT(dllimport); IDENT(__dllimport__); IDENT(dllexport); IDENT(__dllexport__); -IDENT(restrict); IDENT(__restrict); +IDENT(restrict); IDENT(__restrict); IDENT(__restrict__); IDENT(artificial); IDENT(__artificial__); IDENT(leaf); IDENT(__leaf__); IDENT(vector_size); IDENT(__vector_size__); diff --git a/parse.c b/parse.c index 890e56b..7b89cc3 100644 --- a/parse.c +++ b/parse.c @@ -419,6 +419,7 @@ static struct init_keyword { /* Ignored for now.. */ { "restrict", NS_TYPEDEF, .op = &restrict_op}, { "__restrict", NS_TYPEDEF, .op = &restrict_op}, + { "__restrict__", NS_TYPEDEF, .op = &restrict_op}, /* Storage class */ { "auto", NS_TYPEDEF, .op = &auto_op }, @@ -1516,7 +1517,7 @@ static struct token *abstract_array_declarator(struct token *token, struct symbo { struct expression *expr = NULL; - if (match_idents(token, &restrict_ident, &__restrict_ident, NULL)) + if (match_idents(token, &restrict_ident, &__restrict_ident, &__restrict___ident, NULL)) token = token->next; token = parse_expression(token, &expr); sym->array_size = expr; diff --git a/validation/reserved.c b/validation/reserved.c index caacd21..e5d7af8 100644 --- a/validation/reserved.c +++ b/validation/reserved.c @@ -30,6 +30,7 @@ reserved.c:8:12: error: Trying to use reserved word '__const' as identifier reserved.c:9:12: error: Trying to use reserved word '__const__' as identifier reserved.c:10:12: error: Trying to use reserved word 'restrict' as identifier reserved.c:11:12: error: Trying to use reserved word '__restrict' as identifier +reserved.c:12:12: error: Trying to use reserved word '__restrict__' as identifier reserved.c:13:12: error: Trying to use reserved word 'typedef' as identifier reserved.c:14:12: error: Trying to use reserved word '__typeof' as identifier reserved.c:15:12: error: Trying to use reserved word '__typeof__' as identifier