Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 47809 invoked from network); 3 Oct 2005 12:38:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Oct 2005 12:38:32 -0000 Received: (qmail 50146 invoked by uid 500); 3 Oct 2005 12:38:29 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 50086 invoked by uid 500); 3 Oct 2005 12:38:28 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 50075 invoked by uid 99); 3 Oct 2005 12:38:28 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2005 05:38:27 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [209.133.192.6] (HELO devsys.jaguNET.com) (209.133.192.6) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Oct 2005 05:38:32 -0700 Received: (from jim@localhost) by devsys.jaguNET.com (8.11.7a/jag-2.6) id j93Cc6a01631 for dev@httpd.apache.org; Mon, 3 Oct 2005 08:38:06 -0400 (EDT) From: Jim Jagielski Message-Id: <200510031238.j93Cc6a01631@devsys.jaguNET.com> Subject: Re: svn commit: r293305 - in /httpd/httpd/branches/2.2.x/modules: dav/fs/dbm.c To: dev@httpd.apache.org Date: Mon, 3 Oct 2005 08:38:02 -0400 (EDT) Reply-To: jim@jaguNET.com In-Reply-To: <20051003122839.GG6219@redhat.com> from "Joe Orton" at Oct 03, 2005 01:28:39 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 *)((long)(value == 'T')); > > > > > > > > > > - int value = context != NULL; > > > > > + long value = context != NULL; > > > > > apr_fileperms_t perms = resource->info->finfo.protection; > > > > > - int old_value = (perms & APR_UEXECUTE) != 0; > > > > > + long old_value = (perms & APR_UEXECUTE) != 0; > > > > > > > > > > > > > Huh? Whenever I see conditionals cast to (long) I get > > > > suspicious. > > > > > > These are all cases where an integer is stored in a pointer; it's safe > > > to assume that a long will fit in a pointer on all platforms which httpd > > > runs on as a practical consideration, and using a cast to long rather > > > than a cast to int will avoid compiler warnings on LP64 platforms. > > > > > > > The above explanation worries me to no end. :) Certainly a union could be > > used to avoid this. > > Well there are solutions, sure, not sure how a union would help here. > Try it and see... I usually end up deciding these issues are so marginal > that there's some better way to spend time fixing real bugs than to try > and break code which works perfectly well ;) > 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 assumptions in httpd. -- ======================================================================= Jim Jagielski [|] jim@jaguNET.com [|] http://www.jaguNET.com/ "If you can dodge a wrench, you can dodge a ball."