Re: tcc - first impression. Was: Baby X is bor nagain

Liste des GroupesRevenir à cl c  
Sujet : Re: tcc - first impression. Was: Baby X is bor nagain
De : tr.17687 (at) *nospam* z991.linuxsc.com (Tim Rentsch)
Groupes : comp.lang.c
Date : 02. Jul 2024, 14:47:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <86v81nc3d4.fsf@linuxsc.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
User-Agent : Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Michael S <already5chosen@yahoo.com> writes:

On Mon, 01 Jul 2024 14:48:30 -0700
Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>
Michael S <already5chosen@yahoo.com> writes:
[...]
4.2.  Code like below does not compile.  I don't know whether it is
legal 'C' or not,
but gcc, clang and MSVC compilers accept it o.k.
label:int bar;
>
That's a syntax error in versions of C up to and including C17.  C23
allows labels on declarations. [...]
>
Now I paid attention that my statement above is incorrect:  clang does
*not* accept it.
gcc accepts it, for all supported standards, but with -Wpedantic
it issues the warning for all standards except c2x.
MSVC (17 and 19, but not 13) accepts it and issues no warning even with
maximal warning level.
>
clang and tcc are right.  I find no advantages in this sort of rightness.

Is your objection to a diagnostic message being issued, or is
your objection to the construct causing the compilation to fail?

I would call what the more recent MSVC versions do as being
*wrong*.  The C standard requires a diagnostic.

I would not call what clang and tcc do as being right.  Their
behavior conforms to the C standard, but giving an unavoidable
error is kind of obnoxious.

The reported behavior for gcc -pedantic is okay.  It would be
nice if there were a separate option to allow the non-standard
labels to be accepted without giving a warning.  Also it would
be better if -std=cNN implied -pedantic (presumably with a way
to change that, selectively if possible);  historically that
choice might have been okay, but for at least the last 15 years
it has been a disservice to the C community.  I should note
specifically that it is -pedantic that should be implied, and
not -pedantic-error.

More generally, the default behavior for any non-conforming but
often used construct should be a warning, not an error (unless of
course -Werror has been specified).  I understand the motivation
to give an error in the case of a syntax violation, but forcing
any syntax violation to be an error is still a poor choice, not
just for the compiler but also for the C community generally.

Just my opinions, in case that needs saying.

Date Sujet#  Auteur
27 Jun 24 * Re: Baby X is bor nagain36Tim Rentsch
27 Jun 24 +* Re: Baby X is bor nagain2Keith Thompson
28 Jun 24 i`- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 +* Re: Baby X is bor nagain11bart
28 Jun 24 i+- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 i+- Re: Baby X is bor nagain1Tim Rentsch
28 Jun 24 i+* Re: Baby X is bor nagain7Kaz Kylheku
28 Jun 24 ii+- Re: Baby X is bor nagain1Michael S
28 Jun 24 ii`* Re: Baby X is bor nagain5bart
28 Jun 24 ii +* Re: Baby X is bor nagain2bart
28 Jun 24 ii i`- Re: Baby X is bor nagain1bart
28 Jun 24 ii `* Re: Baby X is bor nagain2bart
28 Jun 24 ii  `- Re: Baby X is bor nagain1Michael S
28 Jun 24 i`- Re: Baby X is bor nagain1bart
1 Jul 24 `* tcc - first impression. Was: Baby X is bor nagain22Michael S
1 Jul 24  +- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
1 Jul 24  +* Re: tcc - first impression. Was: Baby X is bor nagain13Keith Thompson
1 Jul 24  i+- Re: tcc - first impression. Was: Baby X is bor nagain1Keith Thompson
2 Jul 24  i+* Re: tcc - first impression. Was: Baby X is bor nagain9Michael S
2 Jul 24  ii+* Re: tcc - first impression. Was: Baby X is bor nagain6bart
2 Jul 24  iii+* Re: tcc - first impression. Was: Baby X is bor nagain4Michael S
2 Jul 24  iiii+* Re: tcc - first impression. Was: Baby X is bor nagain2bart
2 Jul 24  iiiii`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  iiii`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
2 Jul 24  iii`- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
2 Jul 24  ii+- Re: tcc - first impression. Was: Baby X is bor nagain1Tim Rentsch
2 Jul 24  ii`- Re: tcc - first impression. Was: Baby X is bor nagain1James Kuyper
2 Jul 24  i`* Re: tcc - first impression. Was: Baby X is bor nagain2Malcolm McLean
2 Jul 24  i `- Re: tcc - first impression. Was: Baby X is bor nagain1Ben Bacarisse
2 Jul 24  +* Re: tcc - first impression. Was: Baby X is bor nagain6Michael S
2 Jul 24  i+* Re: tcc - first impression. Was: Baby X is bor nagain4Ben Bacarisse
2 Jul 24  ii`* Re: tcc - first impression. Was: Baby X is bor nagain3Michael S
2 Jul 24  ii `* Re: tcc - first impression. Was: Baby X is bor nagain2Ben Bacarisse
2 Jul 24  ii  `- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  i`- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S
3 Jul 24  `- Re: tcc - first impression. Was: Baby X is bor nagain1Michael S

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal