From owner-cvs-all Tue Sep 25 10:55:42 2001 Delivered-To: cvs-all@freebsd.org Received: from repulse.cnchost.com (repulse.concentric.net [207.155.248.4]) by hub.freebsd.org (Postfix) with ESMTP id DD6F637B408; Tue, 25 Sep 2001 10:50:57 -0700 (PDT) Received: from bitblocks.com (adsl-209-204-185-216.sonic.net [209.204.185.216]) by repulse.cnchost.com id NAA05122; Tue, 25 Sep 2001 13:48:56 -0400 (EDT) [ConcentricHost SMTP Relay 1.14] Message-ID: <200109251748.NAA05122@repulse.cnchost.com> To: Warner Losh Cc: Bruce Evans , Murray Stokely , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/sysinstall command.c config.c In-reply-to: Your message of "Tue, 25 Sep 2001 09:37:01 MDT." <200109251537.f8PFb1761123@harmony.village.org> Date: Tue, 25 Sep 2001 10:48:55 -0700 From: Bakul Shah Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > : > I never understood the restriction of why a function ptr > : > can't be cast to void*. It is not like you are going to > : > create self-modifying functions..... > : > : It's because function pointers might be larger than "void *". E.g., on > : i386's in real mode (or in protected mode using "far" pointers), function > : pointers might be "far" and "void *" might be "near". > : > : > Using %x or %lx for > : > printing a fn ptr is as wrong as using %p. And to me %p is > : > likely to be the better choice. > : > : All are wrong. > > We need a %F for functions :-). This is a hole in the ansi spec. %F is already taken (%f and %F differ in the letter-case of inf, infinity and nan) but %P is not. %P for Procedures! Until then I'd suggest using %p. Since it is no worse than %x and we are not likely to port FreeBSD to a machine which has smaller data space than code space. Also, if and when %P is added you have to check far fewer places (people print many more numbers than addresses). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message