Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread Colm MacCarthaigh
On Mon, Oct 03, 2005 at 08:38:02AM -0400, Jim Jagielski wrote: At the very last, if we are assuming behavior which is specifically implementation dependent, then a test during configure time that ensures sizeof(void *) = sizeof(long) makes sense. There is no room, IMO, for silent hidden

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread Joe Orton
On Tue, Oct 04, 2005 at 11:03:31AM +0100, Colm MacCarthaigh wrote: On Mon, Oct 03, 2005 at 08:38:02AM -0400, Jim Jagielski wrote: At the very last, if we are assuming behavior which is specifically implementation dependent, then a test during configure time that ensures sizeof(void *) =

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread André Malo
* Joe Orton [EMAIL PROTECTED] wrote: On Tue, Oct 04, 2005 at 11:03:31AM +0100, Colm MacCarthaigh wrote: On Mon, Oct 03, 2005 at 08:38:02AM -0400, Jim Jagielski wrote: At the very last, if we are assuming behavior which is specifically implementation dependent, then a test during

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread Jim Jagielski
Joe Orton wrote: On Tue, Oct 04, 2005 at 11:03:31AM +0100, Colm MacCarthaigh wrote: On Mon, Oct 03, 2005 at 08:38:02AM -0400, Jim Jagielski wrote: At the very last, if we are assuming behavior which is specifically implementation dependent, then a test during configure time that

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread Jim Jagielski
One comment: I am curious if we should force the casts to unsigned longs, instead of signed longs. This would be more logical. Ideally, a typedef would also make things self-documenting (ap_ptrint_conv_t or whatever), but that's nit picking. I do think the error message is wrong though :) In any

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-04 Thread Colm MacCarthaigh
On Tue, Oct 04, 2005 at 08:11:46AM -0400, Jim Jagielski wrote: I do think the error message is wrong though :) *bangs head off of table* Thanks :) -- Colm MacCárthaighPublic Key: [EMAIL PROTECTED]

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread Jim Jagielski
Brian Candler wrote: Hmm. Given the example pid = (pid_t)((long)apr_hash_get(script_hash, cgid_req.conn_id, sizeof(cgid_req.conn_id))); then it's no good declaring variable 'pid' to be of type apr_intptr_t rather than pid_t, because somewhere down the line it will be passed to a

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread William A. Rowe, Jr.
Brian Candler wrote: Hmm. Given the example pid = (pid_t)((long)apr_hash_get(script_hash, cgid_req.conn_id, sizeof(cgid_req.conn_id))); then it's no good declaring variable 'pid' to be of type apr_intptr_t rather than pid_t, because somewhere down the line it will be passed to a function

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread Brian Candler
On Tue, Oct 04, 2005 at 12:12:14PM -0400, Jim Jagielski wrote: Brian Candler wrote: Hmm. Given the example pid = (pid_t)((long)apr_hash_get(script_hash, cgid_req.conn_id, sizeof(cgid_req.conn_id))); then it's no good declaring variable 'pid' to be of type apr_intptr_t rather

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread Jim Jagielski
Brian Candler wrote: The above line just confuses me, but I haven't taken the time to try to understand the rationale for why it's written the way it is. That's what I was hoping the little example with shorts, longs and void *'s would explain :-) I understand *what* I just don't

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread Rüdiger Plüm
On 10/04/2005 09:32 PM, William A. Rowe, Jr. wrote: Brian Candler wrote: [..cut..] P.S. The reverse case is sillier, given that the value is moving to a *larger* type and therefore no data loss can occur: short a; long b = a; // (7) no warning short a;

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-04 Thread Jim Jagielski
=?UTF-8?B?UsO8ZGlnZXIgUGzDvG0=?= wrote: I do not think so. While a does fit in c from the storage point of view converting c to a different pointer type e.g. (char *) and dereferencing it afterwards most likely leads to SIGBUS or SIGSEGV. So I think a warning is justified here. Yes,

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-03 Thread Joe Orton
On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote: Just some lines that caught my eye: -*context = (void *)(value == 'T'); +*context = (void *)((long)(value == 'T')); -int value = context != NULL; +long value = context != NULL; apr_fileperms_t

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-03 Thread Jim Jagielski
Joe Orton wrote: On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote: Just some lines that caught my eye: -*context = (void *)(value == 'T'); +*context = (void *)((long)(value == 'T')); -int value = context != NULL; +long value = context !=

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-03 Thread Jim Jagielski
Joe Orton wrote: On Mon, Oct 03, 2005 at 08:11:44AM -0400, Jim Jagielski wrote: Joe Orton wrote: On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote: Just some lines that caught my eye: -*context = (void *)(value == 'T'); +*context = (void

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c

2005-10-03 Thread William A. Rowe, Jr.
Joe Orton wrote: On Mon, Oct 03, 2005 at 08:11:44AM -0400, Jim Jagielski wrote: Joe Orton wrote: On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote: Just some lines that caught my eye: ... Whenever I see conditionals cast to (long) I get suspicious. These are all cases where

Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules:

2005-10-03 Thread Jim Jagielski
William A. Rowe, Jr. wrote: Joe Orton wrote: On Mon, Oct 03, 2005 at 08:11:44AM -0400, Jim Jagielski wrote: Joe Orton wrote: On Mon, Oct 03, 2005 at 07:50:39AM -0400, Jim Jagielski wrote: Just some lines that caught my eye: ... Whenever I see conditionals cast to (long) I get