Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c > #144930
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Keith Thompson <kst-u@mib.org> |
| Newsgroups | comp.lang.c, comp.lang.c++ |
| Subject | Re: Switching to C# |
| Date | Sun, 16 Jun 2019 14:24:07 -0700 |
| Organization | None to speak of |
| Lines | 45 |
| Message-ID | <ln8su1ns08.fsf@kst-u.example.com> (permalink) |
| References | <qdr3vq$c0e$1@dont-email.me> <OyiME.971$fv7.530@fx08.fr7> <qe04ln$a3u$1@dont-email.me> <5d03bb38.3305609877@core> <qe37jf$tie$1@news.albasani.net> <5d059fdf.3429680737@core> <lnlfy2ntvy.fsf@kst-u.example.com> <5d05fa0f.3452768783@core> <lnh88popbq.fsf@kst-u.example.com> <5d067312.3483747362@core> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | reader02.eternal-september.org; posting-host="df4904b93ef33b63818a6c0a0a5ba2e4"; logging-data="17531"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18UlntVhYNo8ZS4yPZ/mYMT" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) |
| Cancel-Lock | sha1:Sqawt2mtSck9gcJ7ln7fEvM7Yd4= sha1:5jGXgewAhaena4YUfhMt3jIt0po= |
| Xref | csiph.com comp.lang.c:144930 comp.lang.c++:66486 |
Cross-posted to 2 groups.
Show key headers only | View raw
nobody@example.org (Scott) writes:
> On Sun, 16 Jun 2019 02:24:25 -0700, Keith Thompson <kst-u@mib.org>
> wrote:
>>nobody@example.org (Scott) writes:
>>> On Sat, 15 Jun 2019 19:31:13 -0700, Keith Thompson <kst-u@mib.org>
>>> wrote:
>>>>nobody@example.org (Scott) writes:
>>> Apparently not a fatal one. gcc 7.4 with -std=c99 warns, but builds it
>>> anyway.
>>
>>As I said, it's a constraint violation. That means that a conforming
>>compiler must issue a diagnostic message. It's not required to be
>>fatal. In fact the only construct that required a fatal error is the
>>"#error" directive. (I personally wish gcc were more strict, but that's
>>a whole 'nother kettle of fish.)
>>
>>The lesson is that warnings from C compilers should be taken *very*
>>seriously.
>>
>>"gcc -std=c99 -pedantic" results in a fatal error.
>
> Hmm. Which gcc are you using? Mine (7.4.0) still gives a warning with
> those flags. -pedantic-errors does give an error as I expected. I'm
> not saying you're wrong, I'm just curious why we're seeing different
> results with the same experiment.
>
> The source snippet I used is this:
>
> int main(void) { return 45 != foo("Hello", 2.5, 45); }
> int foo(char *x, double y, int z) { return z; }
Sorry, I messed that up.
"gcc -std=c99" should correctly compile all correct C99 programs.
"gcc -std=c99 -pedantic" should do the same and issue all required
diagnostics. In this mode, it should be a conforming C99 compiler.
"gcc -std=c99 -pedantic-errors" turns all required diagnostics into
fatal errors.
--
Keith Thompson (The_Other_Keith) kst-u@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-12 11:01 -0400
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-12 08:21 -0700
Re: Switching to C# Szyk Cech <szykcech@spoko.pl> - 2019-06-12 17:32 +0200
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-12 12:04 -0400
Re: Switching to C# Szyk Cech <szykcech@spoko.pl> - 2019-06-13 05:50 +0200
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-13 15:43 -0700
Re: Switching to C# gazelle@shell.xmission.com (Kenny McCormack) - 2019-06-12 16:30 +0000
Re: Switching to C# My nuts hurt <cdalten@gmail.com> - 2019-06-13 09:54 -0700
Re: Switching to C# Jens Stuckelberger <Jens_Stuckelberger@nowhere.net> - 2019-06-14 15:28 +0000
Re: Switching to C# gazelle@shell.xmission.com (Kenny McCormack) - 2019-06-14 15:55 +0000
Re: Switching to C# rick.c.hodgin@gmail.com - 2019-06-14 10:25 -0700
Re: Switching to C# scott@slp53.sl.home (Scott Lurndal) - 2019-06-14 17:56 +0000
Whatever will we do without Rick??? (Was: Switching to C#) gazelle@shell.xmission.com (Kenny McCormack) - 2019-06-14 18:02 +0000
Re: Whatever will we do without Rick??? (Was: Switching to C#) rick.c.hodgin@gmail.com - 2019-06-14 12:24 -0700
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-14 14:24 -0400
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-14 12:57 -0400
Re: Switching to C# Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2019-06-15 01:29 +0100
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-12 17:17 -0700
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-12 23:41 -0700
Re: Switching to C# Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2019-06-13 03:30 +0100
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-14 08:43 -0400
Re: Switching to C# nobody@example.org (Scott) - 2019-06-14 15:21 +0000
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-14 12:55 -0400
Re: Switching to C# Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk> - 2019-06-15 01:28 +0100
Re: Switching to C# Bart <bc@freeuk.com> - 2019-06-14 18:07 +0100
Re: Switching to C# David Brown <david.brown@hesbynett.no> - 2019-06-15 09:44 +0200
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-15 01:24 -0700
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-15 02:04 -0700
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-15 03:24 -0700
Re: Switching to C# fir <profesor.fir@gmail.com> - 2019-06-15 03:41 -0700
Re: Switching to C# Anton Shepelev <anton.txt@gmail.com> - 2019-06-16 15:16 +0300
Re: Switching to C# Bonita Montero <Bonita.Montero@gmail.com> - 2019-06-15 18:49 +0200
Re: Switching to C# Bart <bc@freeuk.com> - 2019-06-15 17:58 +0100
Re: Switching to C# Bonita Montero <Bonita.Montero@gmail.com> - 2019-06-16 07:28 +0200
Re: Switching to C# nobody@example.org (Scott) - 2019-06-16 01:58 +0000
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-15 19:31 -0700
Re: Switching to C# nobody@example.org (Scott) - 2019-06-16 08:20 +0000
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-16 02:24 -0700
Re: Switching to C# nobody@example.org (Scott) - 2019-06-16 17:03 +0000
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-16 14:24 -0700
Re: Switching to C# nobody@example.org (Scott) - 2019-06-17 03:02 +0000
Re: Switching to C# Bonita Montero <Bonita.Montero@gmail.com> - 2019-06-16 10:54 +0200
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-16 02:26 -0700
Re: Switching to C# Bonita Montero <Bonita.Montero@gmail.com> - 2019-06-16 12:43 +0200
Re: Switching to C# nobody@example.org (Scott) - 2019-06-16 17:05 +0000
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-16 14:26 -0700
Re: Switching to C# Bonita Montero <Bonita.Montero@gmail.com> - 2019-06-17 06:31 +0200
Re: Switching to C# David Brown <david.brown@hesbynett.no> - 2019-06-16 12:23 +0200
Re: Switching to C# Manfred <noname@invalid.add> - 2019-06-16 23:06 +0200
Re: Switching to C# Keith Thompson <kst-u@mib.org> - 2019-06-16 14:27 -0700
Re: Switching to C# David Brown <david.brown@hesbynett.no> - 2019-06-16 23:33 +0200
Re: Switching to C# James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-06-17 08:30 -0400
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-13 00:06 -0700
Re: Switching to C# "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2019-06-14 08:49 -0400
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-17 23:30 -0700
Re: Switching to C# rick.c.hodgin@gmail.com - 2019-06-18 02:58 -0700
Re: Switching to C# Mel <mel@zzzzz.com> - 2019-06-18 22:46 +0200
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-18 14:00 -0700
Re: Switching to C# Melzzzzz <Melzzzzz@zzzzz.com> - 2019-06-18 21:11 +0000
Re: Switching to C# "Chris M. Thomasson" <invalid_chris_thomasson_invalid@invalid.com> - 2019-06-18 15:36 -0700
Re: Switching to C# rick.c.hodgin@gmail.com - 2019-06-18 15:42 -0700
Re: Switching to C# Melzzzzz <Melzzzzz@zzzzz.com> - 2019-06-19 04:26 +0000
Switching to C# Thiago Adams <thiago.adams@gmail.com> - 2019-06-13 03:05 -0700
Re: Switching to C# Real Troll <real.troll@trolls.com> - 2019-06-13 12:30 -0400
Re: Switching to C# My nuts hurt <cdalten@gmail.com> - 2019-06-13 09:51 -0700
Re: Switching to C# luser droog <luser.droog@gmail.com> - 2019-06-13 09:56 -0700
Re: Switching to C# Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-06-13 22:24 +0000
Re: Switching to C# Tim Rentsch <tr.17687@z991.linuxsc.com> - 2019-06-18 06:33 -0700
csiph-web