Re: [PATCH v6] sparse: add support for _Static_assert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 08, 2017 at 05:15:43PM -0400, Lance Richardson wrote:
> This patch introduces support for the C11 _Static_assert() construct.

For me, it's fine.
I just have a small remarks (see below).
 
> @@ -1945,13 +1953,17 @@ static struct token *declaration_list(struct token *token, struct symbol_list **
>  static struct token *struct_declaration_list(struct token *token, struct symbol_list **list)
>  {
>  	while (!match_op(token, '}')) {
> -		if (!match_op(token, ';'))
> -			token = declaration_list(token, list);
> -		if (!match_op(token, ';')) {
> -			sparse_error(token->pos, "expected ; at end of declaration");
> -			break;
> +		if (match_ident(token, &_Static_assert_ident))
> +			token = parse_static_assert(token, NULL);

I find it better with a 'continue' here

> +		else {

so, this 'else' become unneeded and there is no
more needs to move the previous content of the loop
(which help a lot when reviewing patches or when
digging in the history).

-- Luc
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux