Path: csiph.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: Prioritize Performance over Correctness Date: Fri, 21 Aug 2026 05:49:34 -0700 Organization: A noiseless patient Spider Lines: 22 Message-ID: <86wltjzli9.fsf@linuxsc.com> References: <113ovuj$23t9c$1@dont-email.me> <114f9up$1mm0c$1@dont-email.me> <114ge0v$24ndu$2@dont-email.me> <114h1v7$2b0po$2@dont-email.me> <114h24r$9nm$1@reader1.panix.com> <114h26m$2b0po$3@dont-email.me> <114kain$3erqe$1@dont-email.me> <114rbq0$1op2s$1@dont-email.me> <114rd9b$1o8k3$2@kst.eternal-september.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Fri, 21 Aug 2026 12:49:35 +0000 (UTC) Injection-Info: dont-email.me; logging-data="337760"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18qyDC7Rw6RTVeKxv6H3cb9b2cb3j9eQHg="; posting-host="d35962107532262a9ae9519d5c53ecd4" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:P4XcIWNUFrr16UB04I8hNx5v1Cs= sha1:R5Ao1Lt0PHCQUEAg29b1u+UsaKw= sha256:HAW3QGRqfSTN17s0YMxeR3dj524WHAqwaVkokxb85TU= sha1:Vr0CJNtRM/+fO3feA09YJFBL1MY= sha256:UrT+42+AToqwvLZ3pUk1dpP+9iYtjwXBu3p8lwGaCqc= Xref: csiph.com comp.lang.c:401399 Keith Thompson writes: > The standard doesn't say that function pointers can be converted to > object pointer types or vice versa -- no does it say that they can't. > My conclusion is that the behavior of such a conversion is undefined > by omission. This understanding isn't right, or at best incomplete. A statement like "a pointer to an object type may be converted to a pointer to a different object type" is not a definition of behavior but a statement about what is part of the C language. The C standard lists all cases where a conversion may be done to or from a pointer type; for pointers, any case where there is not an explicit allowance is not part of the C language. Because there is no explicit allowance, an implementation is free to reject any translation unit that calls for such a conversion. Because there is no requirement for a diagnostic, an implementation is free to accept programs that do call for such a conversion. Certainly if an implementation accepts a program that converts an object pointer to a function pointer, or vice versa, then the behavior of any such construct is undefined; but implementations are not obliged to accept any program whose source indicates any such conversion.