Re: Differences between clang and gcc handling of int[static n] function arguments

2023-05-24 Thread Jonathan Wakely via Gcc
On Wed, 24 May 2023 at 10:42, Florian Weimer wrote: > Well, one might be tempted to write that explicit memset to eliminate > the conditional branch, except that it's technically required because > data() might return nullptr. 8-/ Which is why you shouldn't write that code :-) But this is a digre

Re: Differences between clang and gcc handling of int[static n] function arguments

2023-05-24 Thread Florian Weimer via Gcc
* Jonathan Wakely: > On Wed, 24 May 2023 at 10:06, Florian Weimer wrote: >> >> * Jonathan Wakely via Gcc: >> >> >> It seems it might even be trivial enough for me to investigate and >> >> tackle myself, in some spare time. >> >> >> >> I see very little code using either of these features, so it's

Re: Differences between clang and gcc handling of int[static n] function arguments

2023-05-24 Thread Jonathan Wakely via Gcc
On Wed, 24 May 2023 at 10:06, Florian Weimer wrote: > > * Jonathan Wakely via Gcc: > > >> It seems it might even be trivial enough for me to investigate and > >> tackle myself, in some spare time. > >> > >> I see very little code using either of these features, so it's > >> definitely not a high pr

Re: Differences between clang and gcc handling of int[static n] function arguments

2023-05-24 Thread Florian Weimer via Gcc
* Jonathan Wakely via Gcc: >> It seems it might even be trivial enough for me to investigate and >> tackle myself, in some spare time. >> >> I see very little code using either of these features, so it's >> definitely not a high priority task regardless. >> > > Glibc uses the nonnull attribute in

Re: Differences between clang and gcc handling of int[static n] function arguments

2023-05-23 Thread Jonathan Wakely via Gcc
On Mon, 22 May 2023, 00:40 peter0x44 via Gcc, wrote: > > I would be happy to open a PR to improve this warning, if there isn't > one already. > Please do. > > It seems it might even be trivial enough for me to investigate and > tackle myself, in some spare time. > > I see very little code usin

Differences between clang and gcc handling of int[static n] function arguments

2023-05-21 Thread peter0x44 via Gcc
Hi, So, recently I learned about the c99 feature to get NULL pointer checks for array function arguments. I have really never seen this feature used in an actual codebase. It's definitely something I wanted on a few occasions. To be clear, I'm talking about specifically: void foo(int array