Path: csiph.com!news.fcku.it!paganini.bofh.team!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: writing a c program to substitute text Date: Tue, 28 Feb 2017 11:40:53 -0800 Organization: None to speak of Lines: 29 Message-ID: References: <6b1df453-b6df-3cf8-eb6e-255c37ef241a@verizon.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="6f3f7ca58527ffa674d8982151c3ccd8"; logging-data="19679"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19MQM8nR83HM8yIN/JkkSdy" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:NVmNFjXMECKEZ4PPe/1yZMTWC1A= sha1:iXWpM8xeQknEP+b+jwiE5HuGc3Q= Xref: csiph.com comp.lang.c:105150 David Brown writes: > On 28/02/17 17:33, Keith Thompson wrote: [...] >> If you use -pedantic rather than -pedantic-errors, some errors will be >> diagnosed with non-fatal warnings; that's ok if you treat warnings >> *very* seriously. >> > > I like to use -Werror - I /do/ treat warnings very seriously. But > that's me - it is not necessarily a good idea for everyone. Using -pedantic-errors rather than just -pedantic means that diagnostics required by the C standard are fatal. This is, in my opinion, a good idea (except that not all the diagnostic produced by -pedantic[-errors] are mandatory ones; there's one about string literals that exceed a certain length). Using -Werror means that *all* warnings issued by gcc become fatal -- which means you're trusting the gcc authors to decide what non-requires diagnostics you have to avoid in your code. For example, struct foo obj = { 0 }; is a perfectly good idiom, but some older versions of gcc will warn about it if struct foo has more than one scalar member. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"