Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-08 Thread Jens Gustedt
tly propose lengthof as the standardization > - When ISO C accepts _Lengthof and lengthof, map _Lengthof in GCC to >the same internals as __lengthof__, so they are the same thing. > > Still, I'm interested in having some feedback from WG14, to prevent > implementing some

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-08 Thread Jens Gustedt
Am 8. August 2024 13:28:57 MESZ schrieb Joseph Myers : > On Thu, 8 Aug 2024, Alejandro Colomar wrote: > > > Hi Jens, > > > > On Thu, Aug 08, 2024 at 11:13:02AM GMT, Jens Gustedt wrote: > > > > but to maintain expectations, I think it would be better to do >

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-08 Thread Jens Gustedt
Am 8. August 2024 17:42:54 MESZ schrieb Martin Uecker : > Am Donnerstag, dem 08.08.2024 um 16:56 +0200 schrieb Jens Gustedt: > > Am 8. August 2024 13:28:57 MESZ schrieb Joseph Myers : > > > On Thu, 8 Aug 2024, Alejandro Colomar wrote: > > > > > > > Hi Jens

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-08 Thread Jens Gustedt
that would like to follow. And also as said, all other features in the standard, being types, typeof, or expressions, e.g offsetof, unreachable or other gnu extensions, don't have nor need this kind of syntax. We should be designing features for the future, not the past Jens -- Jens

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-08 Thread Jens Gustedt
Am 8. August 2024 19:21:23 MESZ schrieb David Brown : > > > On 08/08/2024 11:13, Jens Gustedt wrote: > > Hi > > > > Am 8. August 2024 10:26:14 MESZ schrieb Alejandro Colomar : > >> Hello Jens, > >> > >> On Thu, Aug 08, 2024 at 07:

Re: v2.1 Draft for a lengthof paper

2024-08-13 Thread Jens Gustedt
ot > been that useful. > > Those emails from 2020 were in fact discussing two completely different > proposals at once: > > 1. Add _Lengthof + #include > 2. Allow static qualifier on compound literals > > Whereas proposal #2 made it into C23 (kudos to Jens Gustedt!),

Re: v2.1 Draft for a lengthof paper

2024-08-13 Thread Jens Gustedt
sing two completely different > > proposals at once: > > > > 1. Add _Lengthof + #include > > 2. Allow static qualifier on compound literals > > Yup. > > > Whereas proposal #2 made it into C23 (kudos to Jens Gustedt!), and as > > you already know by n

RE: v2.1 Draft for a lengthof paper

2024-08-14 Thread Jens Gustedt
se an implementation in the language where doing it in a header can be completely sufficient. Plus, implementing as a macro in a header (probably ) makes also a feature test, for those applications that already have something similar. this was basically what we did for `unreachable` and I think it wo

RE: v2.1 Draft for a lengthof paper

2024-08-14 Thread Jens Gustedt
er dimension sizeof would need a loop, no ? Generally I would be opposed to imposing a complicated solution for a simple feature Jens > > ~Aaron > > -Original Message- > From: Jens Gustedt > Sent: Wednesday, August 14, 2024 8:18 AM > To: Ballman, Aaron ; Alejandr

Re: v2.1 Draft for a lengthof paper

2024-08-14 Thread Jens Gustedt
Am 14. August 2024 14:58:16 MESZ schrieb Alejandro Colomar : > Hi Aaron, Jens, > > On Wed, Aug 14, 2024 at 02:17:52PM GMT, Jens Gustedt wrote: > > Am 14. August 2024 13:31:19 MESZ schrieb "Ballman, Aaron" > > : > > > Sorry for top-post

Re: v2.1 Draft for a lengthof paper

2024-08-14 Thread Jens Gustedt
Am 14. August 2024 16:47:32 MESZ schrieb Alejandro Colomar : > On Wed, Aug 14, 2024 at 03:50:21PM GMT, Jens Gustedt wrote: > > > > > > > > > > That said, I suspect WG14 would not be keen on standardizing > > > > > `lengthof` without an ugly keyword

Re: [PATCH v5 3/3] c: Add __lengthof__ operator

2024-08-07 Thread Jens Gustedt
ds and for expression > operands) covering cases that we *don't* want to support in future, not > just this one that we would like to be supportable in future. > > I don't see any tests for the constraints on external definitions from > 6.9.1 that we discussed - that