Path: csiph.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: question about linker Date: Wed, 11 Dec 2024 15:12:43 -0800 Organization: None to speak of Lines: 43 Message-ID: <87seqtx190.fsf@nosuchdomain.example.com> References: <20241129161517.000010b8@yahoo.com> <87ldwx10gv.fsf@bsb.me.uk> <86ser1kgp5.fsf@linuxsc.com> <87ldwtzlc0.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Thu, 12 Dec 2024 00:12:44 +0100 (CET) Injection-Info: dont-email.me; posting-host="fce124256618fa8243377af1ae3d31f3"; logging-data="1823554"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19waVuf0+U5XJHyZZe8VAb8" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:v+I4SAvMPFmsdVqtKy05T9twZGU= sha1:MtuUIrKqLl5BvxoAQN4DXs8fPGg= Xref: csiph.com comp.lang.c:389569 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.com void Void(void) { Void(); } /* The recursive call of the void */