Sujet : Re: Casting the return value of ...
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.cDate : 08. Jun 2024, 05:23:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86plsskqp2.fsf@linuxsc.com>
References : 1 2 3 4 5 6
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
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.