[Top][All Lists]

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

Re: C Strings and String Literals.

From: Alejandro Colomar
Subject: Re: C Strings and String Literals.
Date: Tue, 15 Nov 2022 21:04:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

Hi Ralph,

On 11/15/22 14:48, Alejandro Colomar wrote:
Here's a compiler which has been told I want C11.

You told it you want C11.

     $ gcc -std=c11 -c str.c

But you didn't tell it to warn about non-conforming code.

Moreover, you asked it to warn about things that may or may not have anything to do with ISO C11.

My mistake, for some reason I misread and thought you had used -Wall. Sorry. However, you still need -Wpedantic -pedantic-warnings, as explained above. GCC is non-conforming unless you ask it explicitly to be a conforming compiler, and even then...

            This enables all  the  warnings  about  constructions
            that  some  users consider questionable, and that are
            easy to avoid (or modify  to  prevent  the  warning),
            even  in  conjunction with macros.  This also enables
            some  language‐specific  warnings  described  in  C++
            Dialect  Options  and  Objective‐C  and Objective-C++
            Dialect Options.




Attachment: OpenPGP_signature
Description: OpenPGP digital signature

reply via email to

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