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
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 *) =
* 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
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
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
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]
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
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
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
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
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;
=?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,
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
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 !=
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
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
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
17 matches
Mail list logo