harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Astapchuk <alex.astapc...@gmail.com>
Subject Re: [drlvm] why not use a defined constant for max int?
Date Tue, 17 Oct 2006 09:01:36 GMT
Geir Magnusson Jr. wrote:
> stdint.h
It's part of C99, not C++.
#7.18.2 of C99 states about INTn_MAX:
'C++ implementations should define these macros only when _ 
_STDC_LIMIT_MACROS is defined before <stdint.h> is included.'

(MSVC does not have such file at all.)

For C++, the <climits> (limits.h) is applicable with INT_MAX or a 
hand-made constant to address specifically 32 bits.

Just my $.02
-- 
Thanks,
   Alex


> 
> Ivan Volosyuk wrote:
>> On 10/17/06, Geir Magnusson Jr. <geir@pobox.com> wrote:
>>> When reviewing HARMONY-1672, there are bits like
>>>
>>>     res.i = (int32)2147483647;
>>>
>>> (not part of the patch, but surrounding code...)
>>>
>>> What is the downside for using INT32_MAX or something portable and
>>> appropriate?  Wouldnt' that make the code more readable?
>>>
>>> geir
>>
>> It is good to use something like. Is it really portable? I cannot find
>> this define in MSVC.
>>
> 
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> 
> 




---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message