[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SCM_POSFIXABLE(-1) fails with MSVC++ 6.0
From: |
Dirk Herrmann |
Subject: |
Re: SCM_POSFIXABLE(-1) fails with MSVC++ 6.0 |
Date: |
Sat, 24 Aug 2002 09:42:51 +0200 (CEST) |
On Fri, 23 Aug 2002, Lars J. Aas wrote:
> Lars J. Aas <address@hidden> wrote:
> : Changing the alternative definition of SCM_LONG_BITS to cast the value
> : to long like this works...
> :
> : # define SCM_LONG_BIT ((long)(SCM_CHAR_BIT * sizeof (long) / sizeof (char)))
>
> Come to think of it, the cast is better placed on the inside so it's more
> evident what is being done (stopping the unsigned-ness of the sizeof()-
> operations to propagate incorrectly out through the macro invokation) so
> it's not removed later by someone not knowing about this compiler bug.
>
> # define SCM_LONG_BIT (SCM_CHAR_BIT * ((long) (sizeof (long) / sizeof
> (char))))
>
> or s/long/int/ on the cast?
>
> BTW, is anyone reading these mails? ;)
>
> Lars J
I am not sure I understand the problem here: is the failure of testing
-1 <= sizeof(long) a compiler bug, or is the strange behaviour defined
in the C language?
Best regards,
Dirk Herrmann