Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: Casting the return value of ...
Date: Fri, 07 Jun 2024 21:23:53 -0700
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <86plsskqp2.fsf@linuxsc.com>
References: <20240328105203.773@kylheku.com> <87frwatadu.fsf@nosuchdomain.example.com> <87bk6yt68v.fsf@nosuchdomain.example.com> <20240328142950.542@kylheku.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Sat, 08 Jun 2024 06:23:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="8f65be1c4faf38596d3aaac82be2db40";
logging-data="2598495"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1827nZekz2Of2T+reghiu7eZ/Vfs4qWqqw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:1pNkoC7C2nKRyB2hsJ/13i9gADQ=
sha1:bI+oUi3n0fsMYS9WP0d2yXOZCGY=
Bytes: 2513
Kaz Kylheku <433-929-6894@kylheku.com> writes:
[gcc documentation talks about "forbidden extensions"]
> The misconception is repeated in the GNU Conding Conventions. It might
> have come from the same person.
>
> https://www.gnu.org/prep/standards/standards.html
>
> But we do not follow either of these specifications rigidly, and
> there are specific points on which we decided not to follow them, so
> as to make the GNU system better for users.
>
> For instance, Standard C says that nearly all extensions to C are
> prohibited. How silly! GCC implements many extensions, some of which
> were later adopted as part of the standard. If you want these
> constructs to give an error message as ?required? by the standard,
> you must specify ?--pedantic?, which was implemented only so that we
> can say ?GCC is a 100% implementation of the standard?, not because
> there is any reason to actually use it.
>
> Standard C does not say that any extensions are prohibited.
> How silly to think so, and write about it, and code a facet of the
> compiler diagnostic system that way!
Probably the people who wrote the gcc documentation mean something
different by the word "extension" than the C standard does. It's
not a good idea to do that, but it does provide a plausible
explanation for why they wrote what they did.