Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Sat, 25 May 2024 16:21:05 -0700 Organization: None to speak of Lines: 22 Message-ID: <87ed9p1nry.fsf@nosuchdomain.example.com> References: <20240523150226.00007e7d@yahoo.com> <87a5kg5voc.fsf@nosuchdomain.example.com> <87fru72elx.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 26 May 2024 01:21:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f86e0e741270de1a6fdb7e3596a53ea0"; logging-data="3247459"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX189vkwftOZjNrhnEzi4tmGS" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:Iv3B7HAFZDg0GxjntFD29qtEzqI= sha1:JqnE2y7hsJWTE1mw8rrqok+3ptw= Xref: csiph.com comp.lang.c:385079 David Brown writes: > On 24/05/2024 21:29, Keith Thompson wrote: [...] >> "static_assert" is already a macro defined in starting in >> C11. The above code is valid in pre-C23, but will break in C11 and C17 >> if it includes directly or indirectly. > > Yes. But including is optional. Your header that defines your own "static_assert" macro might depend on some other header outside your control. A future version of that other header might add a "#include ", breaking your code. There are solutions (check "#ifdef static_assert" for the macro and __STDC_VERSION__ for the keyword, etc.) Perhaps it's not an issue for you, but it's a corner case to keep in mind. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */