groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C Strings and String Literals. (Was: Pascal rides again)


From: Alejandro Colomar
Subject: Re: C Strings and String Literals. (Was: Pascal rides again)
Date: Mon, 15 Jul 2024 10:37:28 +0200

(2 years later...)

Hi Doug!

On 11/13/22 23:39, Douglas McIlroy wrote:
> > Wouldn't it be nice to use -Wunterminated-strings and let the
> > compiler yell at me if I write a string literal [that's too long]?
>
> A good idea. Assuming you use gcc, please propose it at
> https://gcc.gnu.org/bugzilla.

The warning has been merged into gcc.  It will be in gcc-15.
It's called -Wunterminated-string-initialization, enabled in -Wextra.

<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=44c9403ed1833ae71a59e84f9e37af3182be0df5>

Have a lovely day!
Alex

> Apropos of help from the compiler, I normally run gcc via this script
> and stamp out all warnings.
>         #!/bin/bash
>         exec /bin/gcc -Wall -Wpedantic -Wextra "$@"
>
> Doug

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]