From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christopher Li Subject: Re: [PATCH] Sparse fooled by double semicolon Date: Tue, 30 Jan 2007 22:58:38 -0800 Message-ID: <20070131065838.GA23326@chrisli.org> References: <1170219027.11455.68.camel@dv> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from sccrmhc15.comcast.net ([63.240.77.85]:37829 "EHLO sccrmhc15.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932846AbXAaHY5 (ORCPT ); Wed, 31 Jan 2007 02:24:57 -0500 Content-Disposition: inline In-Reply-To: <1170219027.11455.68.camel@dv> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Pavel Roskin Cc: linux-sparse@vger.kernel.org, Josh Triplett Good catch, can you please try the following patch? Chris Fix double semicolon in struct declare Pavel discover this test case: #include void test(void) { struct { int foo;; } val; memset(&val, 0, sizeof(val)); } Sparse creates a member with empty ctype. We should skip that. Signed-Off-By: Christopher Li Index: sparse/parse.c =================================================================== --- sparse.orig/parse.c 2007-01-29 14:46:09.000000000 -0800 +++ sparse/parse.c 2007-01-30 23:11:42.000000000 -0800 @@ -1039,7 +1039,8 @@ static struct token *struct_declaration_ sparse_error(token->pos, "expected ; at end of declaration"); break; } - token = token->next; + while(match_op(token, ';')) + token = token->next; } return token; }