Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-15 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 09:11:52PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > Every little bit adds up. Documentation is simpler if there is naming > > consistency. We have SYNOPSISes in the man pages, and they're up front, > > because they constitu

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Xavier Del Campo Romero
Hello, Could you please unCC me from this discussion? Despite I originally made this proposal, I no longer have an opinion on the subject and there is not much I can add to the discussion anyway. Thank you all very much for your efforts into improving C. Best regards, -- Xavier Del Campo Romer

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
On Wed, Oct 09, 2024 at 09:11:52PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > Every little bit adds up. Documentation is simpler if there is naming > > consistency. We have SYNOPSISes in the man pages, and they're up front, > > because they constitute an import

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > Every little bit adds up. Documentation is simpler if there is naming > consistency. We have SYNOPSISes in the man pages, and they're up front, > because they constitute an important part of the documentation. We also have a convention for future s

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 07:31:50PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > The documentation of an API starts by its prototype. > > > > void login_prompt(char *name, int len); > > void login_prompt(char *name, int size); > > > > The forme

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > The documentation of an API starts by its prototype. > > void login_prompt(char *name, int len); > void login_prompt(char *name, int size); > > The former should _not_ include a NUL terminator in the argument. > The latter should. If th

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
Hi Joseph, On Wed, Oct 09, 2024 at 05:05:16PM GMT, Joseph Myers wrote: > On Wed, 9 Oct 2024, Alejandro Colomar wrote: > > > I'm not fabricating, BTW. Here's a list of off-by-one bugs in login > > code, precisely due to this size-length naming issue: > >

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Joseph Myers
On Wed, 9 Oct 2024, Alejandro Colomar wrote: > I'm not fabricating, BTW. Here's a list of off-by-one bugs in login > code, precisely due to this size-length naming issue: > >

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-09 Thread Alejandro Colomar
[CC -= Jens] Hi Chris, On Tue, Oct 08, 2024 at 03:13:11PM GMT, Chris Bazley wrote: > > ​Because I don't like the paper that has been voted into the standard. > > I kind of presented that paper against my will. I wish GCC merged the > > feature with a different name, and forced the standard to re

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
[CC -= Jens] Hi Joseph, On Tue, Oct 08, 2024 at 03:13:19PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > I have plenty of concerns with > > > both the wording and incompatibility of various changes suggested there > > > related to what's allowed as a sizeof op

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jₑₙₛ Gustedt
Hello everybody, can you please leave me out of this ever spinning discussion? The discussion in Minneapolis has fulfilled my needs on this for the next 10 years at least. I consider forcing people to opt out of mailings as being quite rude. Thanks Jₑₙₛ -- :: ICube

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Chris Bazley
nell; Stephen Coady; Robert Seacord Subject: Re: [PATCH v13 0/4] c: Add __lengthof__ operator On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > I have plenty of concerns with > > both the wording and incompatibility of various changes suggested there > > related to what's allo

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > I have plenty of concerns with > > both the wording and incompatibility of various changes suggested there > > related to what's allowed as a sizeof operand and associated semantics but > > I don't think there were any concerns in that discussion

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Chris Bazley
oning; Daniel Lundin; Nikolaos Strimpas; JeanHeyd Meneide; Fernando Borretti; Jonathan Protzenko; Chris Bazley; Ville Voutilainen; Alex Celeste; Jakub Łukasiewicz; Douglas McIlroy; Jason Merrill; Xavier Del Campo Romero; Siddhesh Poyarekar; DJ Delorie; Carlos O'Donell; Stephen Coady; Ro

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Joseph, On Tue, Oct 08, 2024 at 02:04:12PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > If you wish to wait for Graz to make sure there's no incompatibility > > with ISO, that's another possibility. > > The name could be changed in GCC after Graz (while in >

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 03:40:53PM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 03:28:29PM +0200, Alejandro Colomar wrote: > > On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > > > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT,

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > If you wish to wait for Graz to make sure there's no incompatibility > with ISO, that's another possibility. The name could be changed in GCC after Graz (while in regression-fixes-only mode for GCC 15) if WG14 changes the name in Graz. It wouldn't

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jakub Jelinek
On Tue, Oct 08, 2024 at 03:28:29PM +0200, Alejandro Colomar wrote: > On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > > > Patches 1, 2 and 3 are logically nothing t

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Joseph, On Tue, Oct 08, 2024 at 01:19:06PM GMT, Joseph Myers wrote: > On Tue, 8 Oct 2024, Alejandro Colomar wrote: > > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > > > wait for them to be reviewed

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > How about adding the __lower__ version now as a GNU extension with > compatible semantics, and when it's closer to an ISO C2y release add the > _Upper one? No, we don't need two names. Just _Lengthof suffices. If semantics change in some way durin

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Joseph Myers
On Tue, 8 Oct 2024, Alejandro Colomar wrote: > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > > wait for them to be reviewed so that we only have a single-patch series, > > before doing final review of the

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jakub Łukasiewicz
Yup :) For example that ~ J.Ł. On 2024-10-08 10:33 CEST, Alejandro Colomar wrote: Hi Jakub, On Tue, Oct 08, 2024 at 10:25:24AM GMT, Jakub Łukasiewicz wrote: > I think it would be beneficial to have different syntax/spelling for > features still in development. That way we, as a committee, can

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Jakub Łukasiewicz
I think it would be beneficial to have different syntax/spelling for features still in development. That way we, as a committee, can tweak it as we please, while mitigating effect on early adopters. If what ends in final document is exactly the same as in early phrases, then great, all users a

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
Hi Jakub, On Tue, Oct 08, 2024 at 10:25:24AM GMT, Jakub Łukasiewicz wrote: > I think it would be beneficial to have different syntax/spelling for > features still in development. That way we, as a committee, can tweak it as > we please, while mitigating effect on early adopters. > > If what ends

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-08 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 08:45:48AM GMT, Jakub Jelinek wrote: > On Tue, Oct 08, 2024 at 02:09:52AM +0200, Alejandro Colomar wrote: > > On the other hand, should we provide a version of the operator that is > > free from pedantic warnings? A GNU extension? > > No, why? One can always use (__extens

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Jakub Jelinek
On Tue, Oct 08, 2024 at 02:09:52AM +0200, Alejandro Colomar wrote: > On the other hand, should we provide a version of the operator that is > free from pedantic warnings? A GNU extension? No, why? One can always use (__extension__ _Lengthof (...)). Jakub

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Alejandro Colomar
On Tue, Oct 08, 2024 at 02:04:39AM GMT, Alejandro Colomar wrote: > Hi Joseph, > > On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > > wait for them to be reviewed so that we only have a single-patch series, >

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Alejandro Colomar
Hi Joseph, On Mon, Oct 07, 2024 at 05:35:16PM GMT, Joseph Myers wrote: > Patches 1, 2 and 3 are logically nothing to do with this feature. I'll > wait for them to be reviewed so that we only have a single-patch series, > before doing final review of the main patch. I do not fully understand.

Re: [PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-07 Thread Joseph Myers
Patches 1, 2 and 3 are logically nothing to do with this feature. I'll wait for them to be reviewed so that we only have a single-patch series, before doing final review of the main patch. Since the feature was accepted as _Lengthof, that's the form that should be added to GCC; no __lengthof__

[PATCH v13 0/4] c: Add __lengthof__ operator

2024-10-02 Thread Alejandro Colomar
Hi! This operator is as voted in a WG14 meeting yesterday, with the only difference that we name it __lengthof__ instead of _Lengthof, to be able to add it without being bound by ISO bureaucracy. No semantic changes since v12; only the rename, according to what WG14 preferred. WG14 agreed on the