Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-09 Thread Alejandro Colomar
Hi Joseph, On Tue, Sep 09, 2025 at 12:04:47PM +, Joseph Myers wrote: > On Tue, 9 Sep 2025, Alejandro Colomar wrote: > > > > I don't think we should support any of these. We tightened up various > > > cases of void in parameter lists in C2y (constraint "A parameter > > > declaration shall n

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-09 Thread Joseph Myers
On Tue, 9 Sep 2025, Alejandro Colomar wrote: > > I don't think we should support any of these. We tightened up various > > cases of void in parameter lists in C2y (constraint "A parameter > > declaration shall not specify a void type, except for the special case of > > a single unnamed paramet

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-08 Thread Alejandro Colomar
Hi Joseph, On Mon, Sep 08, 2025 at 09:34:23PM +, Joseph Myers wrote: > On Mon, 8 Sep 2025, Alejandro Colomar wrote: > > > BTW, I'm wondering about the following: > > > > alx@debian:~/tmp$ cat fwd.c > > void j(void; int x); > > void k(void; void); > > void l(void; ...); > >

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-07 Thread Alejandro Colomar
Hi Chris, On Sun, Sep 07, 2025 at 02:38:20PM +0100, Christopher Bazley wrote: > > alx@debian:~/tmp$ cat fwd.c | nl > > 1 void f(int n, int n; int n); > > 2 void g(int n; int n; int n); > > 3 void h(int n, int m; int n, int m); > > 4 void i(int n; int m;

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-07 Thread Christopher Bazley
On 05/09/2025 11:33, Alejandro Colomar wrote: Hi Chris, On Fri, Sep 05, 2025 at 11:15:26AM +0100, Christopher Bazley wrote: On Thu, Sep 4, 2025 at 6:57 PM Joseph Myers wrote: On Wed, 3 Sep 2025, Alejandro Colomar wrote: Hi Joseph, On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wr

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-05 Thread Alejandro Colomar
Hi Chris, On Fri, Sep 05, 2025 at 11:15:26AM +0100, Christopher Bazley wrote: > On Thu, Sep 4, 2025 at 6:57 PM Joseph Myers wrote: > > > > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > > > Hi Joseph, > > > > > > On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wrote: > > > > On Wed, 3

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-05 Thread Christopher Bazley
On Thu, Sep 4, 2025 at 6:57 PM Joseph Myers wrote: > > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > Hi Joseph, > > > > On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wrote: > > > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > > > > > Hi Joseph, > > > > > > > > I'd like to ping ab

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-04 Thread Joseph Myers
On Wed, 3 Sep 2025, Alejandro Colomar wrote: > Hi Joseph, > > On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wrote: > > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > > > Hi Joseph, > > > > > > I'd like to ping about this thread. > > > > As far as I know, nothing has been resolved

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-03 Thread Martin Uecker
Am Mittwoch, dem 03.09.2025 um 22:03 +0200 schrieb Alejandro Colomar: > Hi Joseph, > > On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wrote: > > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > > > Hi Joseph, > > > > > > I'd like to ping about this thread. > > > > As far as I know, no

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-03 Thread Alejandro Colomar
Hi Joseph, On Wed, Sep 03, 2025 at 03:44:28PM +, Joseph Myers wrote: > On Wed, 3 Sep 2025, Alejandro Colomar wrote: > > > Hi Joseph, > > > > I'd like to ping about this thread. > > As far as I know, nothing has been resolved about the semantics (and then > associated documentation and test

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-03 Thread Joseph Myers
On Wed, 3 Sep 2025, Alejandro Colomar wrote: > Hi Joseph, > > I'd like to ping about this thread. As far as I know, nothing has been resolved about the semantics (and then associated documentation and testcases) in the case of parameter forward declarations where multiple declarations for a pa

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-09-03 Thread Alejandro Colomar
Hi Joseph, I'd like to ping about this thread. Cheers, Alex On Tue, Aug 19, 2025 at 12:44:29PM +0200, Alejandro Colomar wrote: > Hi Joseph, > > On Mon, Aug 18, 2025 at 11:19:39PM +, Joseph Myers wrote: > > On Fri, 15 Aug 2025, Alejandro Colomar wrote: > > > > > Hi Joseph, > > > > > > On

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-19 Thread Alejandro Colomar
Hi Joseph, On Mon, Aug 18, 2025 at 11:19:39PM +, Joseph Myers wrote: > On Fri, 15 Aug 2025, Alejandro Colomar wrote: > > > Hi Joseph, > > > > On Thu, Aug 14, 2025 at 10:03:00PM +, Joseph Myers wrote: > > > On Thu, 14 Aug 2025, Alejandro Colomar wrote: > > > > > > > And I'm proposing it

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-18 Thread Martin Uecker
Am Montag, dem 18.08.2025 um 23:19 + schrieb Joseph Myers: > On Fri, 15 Aug 2025, Alejandro Colomar wrote: > > > Hi Joseph, > > > > On Thu, Aug 14, 2025 at 10:03:00PM +, Joseph Myers wrote: > > > On Thu, 14 Aug 2025, Alejandro Colomar wrote: > > > > > > > And I'm proposing it as a GNU ex

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-18 Thread Joseph Myers
On Fri, 15 Aug 2025, Alejandro Colomar wrote: > Hi Joseph, > > On Thu, Aug 14, 2025 at 10:03:00PM +, Joseph Myers wrote: > > On Thu, 14 Aug 2025, Alejandro Colomar wrote: > > > > > And I'm proposing it as a GNU extension, which means we don't even need > > > to care about what ISO C says abo

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-14 Thread Alejandro Colomar
Hi Joseph, On Thu, Aug 14, 2025 at 10:03:00PM +, Joseph Myers wrote: > On Thu, 14 Aug 2025, Alejandro Colomar wrote: > > > And I'm proposing it as a GNU extension, which means we don't even need > > to care about what ISO C says about [n]. We, as a quality > > implementation, treat it with s

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-14 Thread Joseph Myers
On Thu, 14 Aug 2025, Alejandro Colomar wrote: > And I'm proposing it as a GNU extension, which means we don't even need > to care about what ISO C says about [n]. We, as a quality > implementation, treat it with stronger semantics, which this patch uses. As a GNU extension, it's also necessary t

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-14 Thread Alejandro Colomar
Hi Joseph, On Thu, Aug 14, 2025 at 06:44:07PM +, Joseph Myers wrote: > We'd need standard wording that's gone through several rounds of review in > WG14 before there's a reasonable basis for reviewing such a patch, given > how it's based on a very different conceptual model to how array > p

Re: [PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-14 Thread Joseph Myers
We'd need standard wording that's gone through several rounds of review in WG14 before there's a reasonable basis for reviewing such a patch, given how it's based on a very different conceptual model to how array parameters are currently handled in the C standard. (And as noted on the reflecto

[PATCH v1 0/1] c: Add support for array parameters in _Countof

2025-08-14 Thread Alejandro Colomar
Hi! Here's a patch co-authored by Martin and I. It adds support for array parameters in _Countof, which will enable writing safer code that only specifies array bounds in function calls when strictly necessary, reducing the chances for mistakes. Here's an example program that never specifies bou