Sujet : Re: question about linker
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 05. Dec 2024, 23:57:59
Autres entêtes
Organisation : None to speak of
Message-ID : <87y10tzqiw.fsf@nosuchdomain.example.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.13 (Gnus v5.13)
Tim Rentsch <
tr.17687@z991.linuxsc.com> writes:
Michael S <already5chosen@yahoo.com> writes:
On Wed, 4 Dec 2024 21:01:07 +0000
Bart <bc@freeuk.com> wrote:
The C language is one of the most quirky ones around full of
apparently ridiculous things. Why shouldn't you be able to write
this for example:
>
{
....
L:
}
>
This stupid rule means that EVERY label in my generated code
needs to be written as L:; instead of just L:
[...]
I don't know why it was not fixed in 3 subsequent iteration.
>
Probably because the committee thought they had better things to
do. I'd much rather have the changes that were introduced in
C99 and C11 than any time spent on unimportant cosmetic issues
like needing a semicolon after an end-of-block label.
And likely because nobody had submitted a proposal to change it.
Some changes to the C standard originate from committee members,
and some come from proposals submitted by others.
In particular, here are the proposals that resulted in C23 loosening
the requirements for label placements:
https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2496.pdf https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2508.pdfBoth were submitted by Martin Uecker in 2020. (He happens to be a
committee member.) Quite possibly the change would have been made
sooner if anyone had suggested it.
Writing and submitting such a proposal is a non-trivial effort, and
the burden of writing "L:;" rather than "L:" in a few cases is light
enough that I'm not surprised it took as long as it did to change it.
I'll note that the C23 syntax introduces some mild complications.
It defines a "statement" as either a "labeled-statement" or an
"unlabeled-statement", but it also defines a "block-item" as a
"declaration", an "unlabeled-statement", or a "label". Which means
that a labeled statement is a single statement, but is treated as
two items within a compound statement.
Martin Uecker's proposal includes:
Optional Additional Change
6.11.X Labeled Statements
Labels outside of compound statements are an obsolescent feature.
This part was not adopted in C23. All labels are within some
compound statement, but I believe this refers to things like:
if (condition)
label: statement;
(I'd add braces anyway.)
I'm not suggesting that there's any real ambiguity, just that it
could be a little confusing. Even for such a simple change, there
can be a cost.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */