Hi Joseph,

On Mon, Jul 29, 2024 at 11:13:08AM GMT, Joseph Myers wrote:
> On Sun, 28 Jul 2024, Alejandro Colomar wrote:
> 
> >  gcc/Makefile.in               |  1 +
> >  gcc/c-family/c-common.cc      | 20 +++++++++
> >  gcc/c-family/c-common.def     |  4 ++
> >  gcc/c-family/c-common.h       |  2 +
> >  gcc/c/c-parser.cc             | 35 +++++++++++----
> >  gcc/c/c-tree.h                |  4 ++
> >  gcc/c/c-typeck.cc             | 84 +++++++++++++++++++++++++++++++++++
> >  gcc/cp/cp-tree.h              |  1 -
> >  gcc/cp/operators.def          |  1 +
> >  gcc/cp/tree.cc                | 13 ------
> >  gcc/ginclude/stdlength.h      | 35 +++++++++++++++
> >  gcc/rust/backend/rust-tree.cc | 13 ------
> >  gcc/rust/backend/rust-tree.h  |  2 -
> >  gcc/target.h                  |  3 ++
> >  gcc/tree.cc                   | 13 ++++++
> >  gcc/tree.h                    |  1 +
> 
> Please start with documentation and testcases, neither of which are 
> included here

While I haven't started yet with test cases within the test suite, I
have tests.  There's a test program in the cover letter of the patch set
is the draft of a test suite for the feature.

Running the test suite is much more uncomfortable (to me) than compiling
a program manually, for iterating on the feature.  I need to get used to
this test suite.  :)

> - making sure that both documentation and testcases cover 
> all the error cases and questions of e.g. evaluation of VLA operands.  
> Documentation and testcases are the most important pieces for reviewing a 
> proposed addition of a new language feature, before the actual 
> implementation.

I was just having a look at what can be done.  Now that it's working for
the cases I wanted it to work, I've started documenting it.  I'll also
have a look at adding the tests to the test suite, although that will
take a few more iterations probably.

> A relevant semantic question to answer here: sizeof evaluates all VLA 
> operands, should this operator do likewise, or should it only evaluate 
> when the toplevel array is of variable length (but not for a 
> constant-length array of variable-size elements)?

I see benefits of both approaches.  The former is trivial to implement.
I'm not sure how much work would be needed for the latter, but probably
a bit more than that.  As a programmer, I think I would ask for the
latter; I guess that's what we'd want, ideally.  Thanks for the
feedback!  :)

Have a lovely night!
Alex

> -- 
> Joseph S. Myers
> josmy...@redhat.com
> 

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to