Hi Joseph, On Tue, Nov 11, 2025 at 06:21:00PM +0000, Joseph Myers wrote: > On Tue, 11 Nov 2025, Alejandro Colomar wrote: > > > I've significantly simplified this. However, the diagnostics are a bit > > worse. For example: > > > > c.c:9:16: error: invalid application of ‘_Maxof’ to something not a type > > 9 | _Maxof(static int); > > | ^~~~~~ > > c.c:9:16: error: expected ‘;’ before ‘static’ > > 9 | _Maxof(static int); > > | ^~~~~~ > > | ; > > c.c:9:26: error: expected statement before ‘)’ token > > 9 | _Maxof(static int); > > | ^ > > > > Is this acceptable? The first diagnostic is correct, but the others are > > consequences of failing too early in the parsing. > > I think it's reasonable,
Okay.
> but you may be able to reduce the number of
> diagnostics, by using the matching_parens machinery (with
> skip_until_found_close) to go to the closing ')' after parsing the type
> name (successfully or unsuccessfully).
Okay, thanks. BTW, how should I deal with those excess errors in the
testsuite? Tests like
_Maxof (static int); /* { dg-error "to something not a type" } */
trigger excess errors that I don't know how to deal with.
c.c:12:16: error: invalid application of ‘_Maxof’ to something not a
type
12 | _Maxof(static int);
| ^~~~~~
c.c:12:16: error: expected ‘)’ before ‘static’
12 | _Maxof(static int);
| ~^~~~~~
| )
The second error triggers the excess errors issue in the testsuite.
Or are we fine with the testsuite failing due to excess errors?
I could maybe move all filures with excess errors to a file
maxof-excess-errors.c
Or is there a way to deal with this with the dg-error comments?
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es>
Use port 80 (that is, <...:80/>).
signature.asc
Description: PGP signature
