On Wed, May 21, 2025 at 11:44:42PM +0200, Alejandro Colomar wrote:
> Does this sound good?
>
> diff --git i/gcc/c/c-parser.cc w/gcc/c/c-parser.cc
> index faa03c4903a2..733cb312341e 100644
> --- i/gcc/c/c-parser.cc
> +++ w/gcc/c/c-parser.cc
> @@ -78,16 +78,6 @@ along w
Hi Jakub,
On Wed, May 21, 2025 at 11:47:30PM +0200, Jakub Jelinek wrote:
> > @@ -1747,6 +1737,8 @@ static struct c_expr c_parser_binary_expression
> > (c_parser *, struct c_expr *,
> > tree);
> > static struct c_expr c_parser_cast_expr
Hi Jakub,
On Wed, May 21, 2025 at 11:31:05PM +0200, Alejandro Colomar wrote:
> > > +#define c_parser_sizeof_expression(parser)
> > > \
> > > +(
> > > \
> > > + c_parser_sizeof_or_count
On Wed, May 21, 2025 at 11:31:01PM +0200, Alejandro Colomar wrote:
> The preexisting ones are not just the outermost ones. The preexisting
> code was
>
> (in_sizeof
>? "sizeof"
>: (in_typeof ? "typeof" : "alignof")));
>
> The only pattern I can find
On Wed, May 21, 2025 at 11:36:56PM +0200, Alejandro Colomar wrote:
> Hi Jakub,
>
> On Wed, May 21, 2025 at 11:12:07PM +0200, Jakub Jelinek wrote:
> > > warning_at (loc, OPT_Wc___compat,
> > > "defining type in %qs expression is invalid in C++",
> > > (in_sizeof
> > >
Hi Jakub,
On Wed, May 21, 2025 at 11:12:07PM +0200, Jakub Jelinek wrote:
> > warning_at (loc, OPT_Wc___compat,
> > "defining type in %qs expression is invalid in C++",
> > (in_sizeof
> > ? "sizeof"
> > -: (in_typeof ? "typeof" : "alignof")));
>
Hi Jakub,
On Wed, May 21, 2025 at 11:12:07PM +0200, Jakub Jelinek wrote:
> > * c-common.h: Add RID_COUNTOF.
>
> (enum rid): Add RID_COUNTOF.
Okay.
>
> > (c_countof_type): New function prototype.
> > * c-common.def (COUNTOF_EXPR): New tree.
> > * c-common.cc
> > (c_common_re
On Wed, May 21, 2025 at 11:01:31PM +0200, Alejandro Colomar wrote:
> 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 re
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