Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Sandra Loosemore
On 2/26/24 09:19, Joseph Myers wrote: On Mon, 26 Feb 2024, Alejandro Colomar wrote: The idea seems reasonable, but the patch needs documentation for the new option in invoke.texi. Thanks! Will do. I don't see an obvious order in that file. Where would you put the option? Do you want me to

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Mike Stump
On Feb 26, 2024, at 7:56 AM, Alejandro Colomar wrote: > > I don't see an obvious order in that file. Where would you put the > option? The best place, would be to put it just after: -Warray-bounds -Warray-bounds=n This is a functional style grouping that best mirrors the existing orde

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Joseph Myers
On Mon, 26 Feb 2024, Alejandro Colomar wrote: > > The idea seems reasonable, but the patch needs documentation for the new > > option in invoke.texi. > > Thanks! Will do. > > I don't see an obvious order in that file. Where would you put the > option? Do you want me to sort(1) it first, and

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Alejandro Colomar
Hi Joseph, On Mon, Feb 26, 2024 at 03:24:32PM +, Joseph Myers wrote: > On Sun, 25 Feb 2024, Mike Stump wrote: > > > On Feb 6, 2024, at 2:45 AM, Alejandro Colomar wrote: > > > > > > Warn about the following: > > > > > >char s[3] = "foo"; > > > > No ObjC specific impact here, so no nee

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Joseph Myers
On Sun, 25 Feb 2024, Alejandro Colomar wrote: > or if it's just that everyone was busy doing > other stuff. Yes, that's right. The patch was already listed on my patch review backlog, but that backlog is long. -- Joseph S. Myers josmy...@redhat.com

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-26 Thread Joseph Myers
On Sun, 25 Feb 2024, Mike Stump wrote: > On Feb 6, 2024, at 2:45 AM, Alejandro Colomar wrote: > > > > Warn about the following: > > > >char s[3] = "foo"; > > No ObjC specific impact here, so no need for ObjC review. > > As a member of the peanut gallery, I like the patch. > > Joseph, th

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-25 Thread Alejandro Colomar
Hi Mike, Joseph, On Sun, Feb 25, 2024 at 10:10:09AM -0800, Mike Stump wrote: > On Feb 6, 2024, at 2:45 AM, Alejandro Colomar wrote: > > > > Warn about the following: > > > >char s[3] = "foo"; > > No ObjC specific impact here, so no need for ObjC review. > > As a member of the peanut gall

Re: [PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-25 Thread Mike Stump
On Feb 6, 2024, at 2:45 AM, Alejandro Colomar wrote: > > Warn about the following: > >char s[3] = "foo"; No ObjC specific impact here, so no need for ObjC review. As a member of the peanut gallery, I like the patch. Joseph, this is been submitted 5 times over the past year. Any thoughts

[PATCH v5 RESEND] C, ObjC: Add -Wunterminated-string-initialization

2024-02-06 Thread Alejandro Colomar
Warn about the following: char s[3] = "foo"; Initializing a char array with a string literal of the same length as the size of the array is usually a mistake. Rarely is the case where one wants to create a non-terminated character sequence from a string literal. In some cases, for writing