Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C Names and Scopes Date: Thu, 09 Feb 2017 13:57:51 -0800 Organization: None to speak of Lines: 35 Message-ID: References: <87vasj5efl.fsf@bsb.me.uk> <87poir5a1y.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="ecbc845b6da81c9d4b7b978122232250"; logging-data="25086"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18SU6wX39n7ZaAoi9G36cyc" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:/Iu4jzeSaHeWecFjXuZe+kkLOIU= sha1:r/FoXHnMM5f2QFtcb6A8UgFNwyQ= Xref: csiph.com comp.lang.c:103573 Ben Bacarisse writes: > Keith Thompson writes: >> Ben Bacarisse writes: >>> BartC writes: >>> >>>> ... What exactly do you have to do to make it report an >>>> error, rather than a warning? >>> >>> -Werror >> >> Or -pedantic-errors. >> >> -Werror turns all warnings into fatal errors, which is great if you want >> to reject everything that gcc warns about, but it can be overkill. >> >> -pedantic errors causes all standard-required diagnostics to be fatal >> errors. Use it along with, for example, -std=c11. > > Yes, thanks, that's often much more useful. And, in this case, you > don't even need to give a -std= argument (though no doubt that helps in > other cases), as plain gcc -pedantic-errors then reports a lone type as > an error. Yes, but the default version has changed with different releases of gcc. Prior to gcc 5, IIRC, the default was "-std=gnu89" (C89/C90 with GNU-specific extensions). In gcc 5 and later, the default is "-std=gnu11". If you're compiling code on multiple platforms, as BartC seems to be doing, it's probably best to specify which standard you want. -- 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"