Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Sort of trivial code challenge - may be interesting to you anyway Date: Tue, 10 Mar 2026 15:25:19 -0700 Organization: None to speak of Lines: 35 Message-ID: <87bjgv2ugg.fsf@example.invalid> References: <10n80sc$3soe4$1@dont-email.me> <86ms0peby6.fsf@linuxsc.com> <10ockdh$3qpk6$1@dont-email.me> <10ocrjn$3qpk6$2@dont-email.me> <10od64s$3qpk6$4@dont-email.me> <86ikb9bmtw.fsf@linuxsc.com> <10oem5t$n5hk$1@dont-email.me> <86o6kz9zng.fsf@linuxsc.com> <10oi72k$1rss6$1@dont-email.me> <10oid0u$1u9aa$2@dont-email.me> <10ok1sl$2e7mc$1@dont-email.me> <10ok405$2f6sn$1@dont-email.me> <10ok7mt$2e7mc$5@dont-email.me> <10oking$2jsja$1@dont-email.me> <10onrkk$3s7id$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Tue, 10 Mar 2026 22:25:20 +0000 (UTC) Injection-Info: dont-email.me; posting-host="3910b6dc5d90e35cad7228c22c833e45"; logging-data="672827"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+3gFfIdvjcUwr06VAT1otb" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:XjKigs75EWttOpOZc/BKP/WgnzU= sha1:k05ULRSkilVkm+UmGMWjIEodQKk= Xref: csiph.com comp.lang.c:396889 scott@slp53.sl.home (Scott Lurndal) writes: > DFS writes: >>On 3/8/2026 3:29 PM, Bart wrote: >>> note that setjmp/longjmp are not functions >> >>huh? >> >>https://man7.org/linux/man-pages/man3/longjmp.3.html > > POSIX allows setjmp to be defined as a macro. > > https://pubs.opengroup.org/onlinepubs/9799919799/functions/setjmp.html More to the point, ISO C (all editions from C90 to C23) specifies that setjmp is a macro, and longjmp is a function. (Like any library function, longjmp can *also* be implemented as a macro). As it happens, glibc's has: #define setjmp(env) _setjmp (env) where _setjmp is a function. POSIX says: It is unspecified whether setjmp() is a macro or a function. If a macro definition is suppressed in order to access an actual function, or a program defines an external identifier with the name setjmp, the behavior is undefined. which may be inconsistent with ISO C. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */