Path: csiph.com!news.mixmin.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan Date: Tue, 11 Apr 2023 12:50:13 -0700 Organization: None to speak of Lines: 19 Message-ID: <874jpmfbbe.fsf@nosuchdomain.example.com> References: <87zg7n89zw.fsf@bsb.me.uk> <874jpv84uv.fsf@bsb.me.uk> <20230407042121.909@kylheku.com> <86r0st3zj0.fsf@linuxsc.com> <871qkshmhv.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain Injection-Info: dont-email.me; posting-host="6b1c659db000f6ddffd5df2e4cc173ab"; logging-data="2849023"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/m6P4u3WdwgNZZY+0Bxf4" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:E83YDRlCr+LF/xUd+GysWfMjCNc= sha1:ElaplzvteOSrvQnPdCdxT8NyxCw= Xref: csiph.com comp.lang.c:169984 David Brown writes: [...] > The only real use I have seen for non-prototype function declarations > is a "general" function pointer in arrays containing mixed function > pointer types. Such use is no longer allowed in C23. Is that what > you are concerned about? Normally a better choice of general function > pointer is "void foo(void)", rather than "int foo()". (In C23, the > later would now mean "int foo(void)".) I haven't often had a need for a generic function pointer type (as void* is a generic object pointer type), but I suggest that using a return type that's not used elsewhere might be safer. If you use `void(void)` as a generic function type, there's a risk that a call without a cast will quietly compile. -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */