You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jim Jagielski <ji...@jaguNET.com> on 2005/10/04 21:35:29 UTC

Re: svn commit: r294902 - /httpd/httpd/trunk/acinclude.m4

colm@apache.org wrote:
> 
> Author: colm
> Date: Tue Oct  4 12:25:51 2005
> New Revision: 294902
> 
> URL: http://svn.apache.org/viewcvs?rev=294902&view=rev
> Log:
> Invert the "yes" and "no" values for $ap_void_ptr_lt_long, which
> as Rudiger points out; are exactly wrong.
> 
> -if test "$ap_void_ptr_lt_long" = "no"; then
> +if test "$ap_void_ptr_lt_long" = "yes"; then
>      AC_MSG_ERROR([Size of "void *" is less than size of "long"])
> 

Don't shoot me :)

The problem is whether or not a pointer will fit in a long.
Is the site of void* is smaller than a long, that's
OK (if it fits in an int and sizeof(int)<sizeof(long)
that is perfectly OK).

Bill suggested figuring out what the smallest int that would
safely hold a void* and making that a typedef. And pointers
are always unsigned, iirc.

-- 
=======================================================================
 Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
           "If you can dodge a wrench, you can dodge a ball."

Re: svn commit: r294902 - /httpd/httpd/trunk/acinclude.m4

Posted by Colm MacCarthaigh <co...@stdlib.net>.
On Tue, Oct 04, 2005 at 03:35:29PM -0400, Jim Jagielski wrote:
> > -if test "$ap_void_ptr_lt_long" = "no"; then
> > +if test "$ap_void_ptr_lt_long" = "yes"; then
> >      AC_MSG_ERROR([Size of "void *" is less than size of "long"])
> > 
> 
> Don't shoot me :)
> 
> The problem is whether or not a pointer will fit in a long.
> Is the site of void* is smaller than a long, that's
> OK (if it fits in an int and sizeof(int)<sizeof(long)
> that is perfectly OK).

I don't see how that could be o.k.. when we have code like;

	*context = (void *)((long)(value == 'T')); 

Where *context is a "void *" (context itself is defined void **).

I'll have to revert the compiler-warning-fixes entirely to remove that
assumption. I'm o.k. with that, we'll then have slightly different
assumptions I think, but they can be tested for too.

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Re: svn commit: r294902 - /httpd/httpd/trunk/acinclude.m4

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Jim Jagielski wrote:
> Bill suggested figuring out what the smallest int that would
> safely hold a void* and making that a typedef. And pointers
> are always unsigned, iirc.

Yes, but there should be no issue with caching an int (signed)
in a void*.  They are unsigned in that comparing void *p to 0,
you will never find p < 0.  Once it's cast to an int, of course,
it's sign can be restored.

Bill