Sujet : Re: question about linker
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.lang.cDate : 12. Dec 2024, 00:12:43
Autres entêtes
Organisation : None to speak of
Message-ID : <87seqtx190.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Gnus/5.13 (Gnus v5.13)
antispam@fricas.org (Waldek Hebisch) writes:
[...]
Technically, 'do' loop ends in a semicolon. Rule is
>
do secondary-block while ( expression ) ;
>
with explicit semicolon at the end.
>
'while' loop do not have any special symbol marking its end.
Grammar for 'while' is
>
while ( expression ) secondary-block
>
and it ends where 'secondary-block' ends which may be a semicolon
but may be also a brace.
[...]
To those who were unfamiliar with the term "secondary-block" (as I was),
it was introduced in C23. It's defined simply as a statement.
In C17 and earlier, the grammar for a do or while loop uses "statement"
directly:
while ( expression ) statement
do statement while ( expression ) ;
C23 defines:
primary-block:
compound-statement
selection-statement
iteration-statement
secondary-block:
statement
The reason for the new distinction, if I understand correctly,
is that attribute specifiers can be applied to a primary-block or
a jump-statement, but not to other kinds of statements.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */