On Wed, 21 May 2025, Alejandro Colomar wrote:
> Makes sense. I'm unsure where exactly I should put it. Is this okay?
>
> diff --git i/gcc/c/c-parser.cc w/gcc/c/c-parser.cc
> index 87700339394b..08350a216dd8 100644
> --- i/gcc/c/c-parser.cc
> +++ w/gcc/c/c-parser.cc
>
Hi Joseph,
On Wed, May 21, 2025 at 04:26:46PM +, Joseph Myers wrote:
> On Wed, 21 May 2025, Alejandro Colomar wrote:
>
> > @@ -10572,6 +10583,8 @@ c_parser_unary_expression (c_parser *parser)
> > case CPP_KEYWORD:
> >switch (c_parser_peek_token (parser)->keyword)
> > {
> > +
On Wed, 21 May 2025, Alejandro Colomar wrote:
> @@ -10572,6 +10583,8 @@ c_parser_unary_expression (c_parser *parser)
> case CPP_KEYWORD:
>switch (c_parser_peek_token (parser)->keyword)
> {
> + case RID_COUNTOF:
> + return c_parser_countof_expression (parser);
> c
This operator is similar to sizeof but can only be applied to an array,
and returns its number of elements.
FUTURE DIRECTIONS:
- We should make it work with array parameters to functions,
and somehow magically return the number of elements of the array,
regardless of it being really a poin