On Fri, Oct 23, 2015 at 10:31:55PM +0200, Jakub Jelinek wrote: > Doesn't this mean that you happily parse > gang (static: * abc) > or > gang (static:*num:1) > etc.? I'd say the comma should be non-optional (i.e. either accept > CPP_COMMA, or CPP_CLOSE_PARENT, but nothing else) in that case (at least, > when in OpenMP grammar something is *-list it is meant to be comma > separated).
Looking at the OpenACC standard, gang-arg-list is indeed a comma separated list of gang-arg, so the above are not valid, so you really should just error out and skip to close paren if at that spot isn't a CPP_COMMA or CPP_CLOSE_PAREN. And for vector/worker arguments, which don't accept a *-list, IMNSHO you shouldn't even try to accept CPP_COMMA, just require CPP_CLOSE_PAREN. > > > + /* Consume a comma if present. */ > > + if (c_parser_next_token_is (parser, CPP_COMMA)) > > + c_parser_consume_token (parser); > > Similarly this means > gang (num: 5 static: *) > is accepted. If it is valid, then again it should have testsuite coverage. Jakub