Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Sep 2001 10:48:55 -0700
From:      Bakul Shah <bakul@bitblocks.com>
To:        Warner Losh <imp@harmony.village.org>
Cc:        Bruce Evans <bde@zeta.org.au>, Murray Stokely <murray@FreeBSD.org>, cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/usr.sbin/sysinstall command.c config.c 
Message-ID:  <200109251748.NAA05122@repulse.cnchost.com>
In-Reply-To: Your message of "Tue, 25 Sep 2001 09:37:01 MDT." <200109251537.f8PFb1761123@harmony.village.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
> : > 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109251748.NAA05122>