Hi Jonathan,
On 11/14/22 14:14, Jonathan Wakely wrote:
On Mon, 14 Nov 2022 at 11:38, Alejandro Colomar via Gcc wrote:
Hi Andrew!
On 11/13/22 23:12, Andrew Pinski wrote:
On Sun, Nov 13, 2022 at 1:57 PM Alejandro Colomar via Gcc
wrote:
Hi!
I'd like to get warnings if I write the following
Hi Jonathan,
On 11/14/22 14:14, Jonathan Wakely wrote:
On Mon, 14 Nov 2022 at 11:38, Alejandro Colomar via Gcc wrote:
BTW, I had another idea to add a suffix to string literals to make them
unterminated:
char foo[3] = "foo"u; // OK
char bar[4] = "bar"; // OK
char baz[4] = "baz"u; // Warn
On Mon, 14 Nov 2022 at 11:38, Alejandro Colomar via Gcc wrote:
>
> Hi Andrew!
>
> On 11/13/22 23:12, Andrew Pinski wrote:
> > On Sun, Nov 13, 2022 at 1:57 PM Alejandro Colomar via Gcc
> > wrote:
> >>
> >> Hi!
> >>
> >> I'd like to get warnings if I write the following code:
> >>
> >> char foo[3]
Hi Andrew!
On 11/13/22 23:12, Andrew Pinski wrote:
On Sun, Nov 13, 2022 at 1:57 PM Alejandro Colomar via Gcc
wrote:
Hi!
I'd like to get warnings if I write the following code:
char foo[3] = "foo";
This should be easy to add as it is already part of the -Wc++-compat
option as for C++ it is
On Sun, Nov 13, 2022 at 1:57 PM Alejandro Colomar via Gcc
wrote:
>
> Hi!
>
> I'd like to get warnings if I write the following code:
>
> char foo[3] = "foo";
This should be easy to add as it is already part of the -Wc++-compat
option as for C++ it is invalid code.
:2:19: warning: initializer-str
Hi!
I'd like to get warnings if I write the following code:
char foo[3] = "foo";
It's hard to keep track of sizes to make sure that the string literals always
initialize to terminated strings. It seems something that should be easy to
implement in the compiler.
A morecomplex case where it'