Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Sort char array Date: Mon, 07 Oct 2019 17:02:11 -0700 Organization: None to speak of Lines: 37 Message-ID: References: <87ftk7nwlx.fsf@bsb.me.uk> <5i3mF.952079$aI7.587046@fx22.am4> <87a7afnmiq.fsf@bsb.me.uk> <8636g5ap5m.fsf@linuxsc.com> <20191007131948.c9f28d44bcd105e7a153069a@g{oogle}mail.com> <2xFmF.867378$yH4.431562@fx18.am4> <20191007174244.385138503569a8bc6d4eec9d@g{oogle}mail.com> <20191008022725.36fbd95aa45ba185290e5e11@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: reader02.eternal-september.org; posting-host="a246233549c394348cfe195f5e562d6b"; logging-data="13301"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/8XBkugTKhoeFSEJxXXiLE" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:6YqCwh3msvxZCP29gru5hhV16M4= sha1:7OTduSpB0ecfL/SkJm1WEskLkRc= Xref: csiph.com comp.lang.c:146716 Anton Shepelev writes: > Bart: [...] >> Nor with a label pointer (a gcc extension). Yet gcc allows >> a conversion to/from void*. -pedantic will still generate >> a warning, but only that it is non-standard. It doesn't >> say it is Verboten. > > That's a problem with gcc, rather than with C. I belive gcc > has another set of options activating the treatment of some > warnings as errors. C requires a diagnostic for any violation of a constraint or syntax rule. It does not require the diagnostic to be fatal. A fully conforming C implementation can compile and generate an executable for a program with arbitrary errors, as long as it issues at least one compile-time warning. (I personally dislike this, but that's what the C standard says.) Only a #error directive that survives preprocessing actually requires a conforming compiler to fail to compile something. "gcc -std=c11 -pedantic" issues non-fatal warnings for many constraint violations -- which satisfies the C standard's requirements. "gcc -std=c11 -pedantic-errors" turns those warnings into fatal errors -- which also satisfies the C standard's requirements. ("gcc ... -Werror" turns all warnings into fatal errors, which is not conforming. The fact that it's not conforming doesn't mean it's not useful.) [...] -- Keith Thompson (The_Other_Keith) kst-u@mib.org Will write code for food. void Void(void) { Void(); } /* The recursive call of the void */