From owner-freebsd-hackers Thu Jan 17 10:26:49 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.22.195.2]) by hub.freebsd.org (Postfix) with ESMTP id 82D8237B419 for ; Thu, 17 Jan 2002 10:26:45 -0800 (PST) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #2) id 16RHFH-0000Im-00 (Debian); Thu, 17 Jan 2002 18:26:39 +0000 Date: Thu, 17 Jan 2002 18:26:39 +0000 From: Tony Finch To: hackers@freebsd.org Cc: dot@dotat.at Subject: pedantic kobj problem Message-ID: <20020117182639.A26828@chiark.greenend.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii User-Agent: Mutt/1.0.1i Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I note that kobj uses a pointer to int kobj_error_method(void) when it can't find an implementation of an interface in a class's method list and the interface has no default implementation. However, the C standard says in section 6.3.2.3: [#8] A pointer to a function of one type may be converted to a pointer to a function of another type and back again; the result shall compare equal to the original pointer. If a converted pointer is used to call a function whose type is not compatible with the pointed-to type, the behavior is undefined. and kobj_error_method is (necssarily) of a different type from all actual interfaces. Obviously this doesn't matter except in perverted C implementations that (say) use pascal calling conventions, but I note it in case of anyone trying to use kobj on such a system :-) Tony. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message