[PATCH] c++ify sreal
Uros Bizjak
ubizjak@gmail.com
Tue Nov 11 08:48:00 GMT 2014
On Tue, Nov 11, 2014 at 9:11 AM, Jakub Jelinek <jakub@redhat.com> wrote:
>> >>> do $subject, and cleanup for always 64 bit hwi.
>> >>>
>> >>>
>> >>> bootstrapped + regtested x86_64-unknown-linux-gnu, ok?
>> >>
>> >> Ok. Can you please replace remaining HOST_WIDE_INT
>> >> vestiges in there with [u]int64_t please?
>> >
>> >
>> > This patch breaks the build on debian 6.0:
>> >
>> > ../../gcc/sreal.c: In member function āint64_t sreal::to_int() constā:
>> > ../../gcc/sreal.c:159: error: āINT64_MAXā was not declared in this scope
>>
> Still, I don't believe it will be portable everywhere.
> Can't you use
> INTTYPE_MAXIMUM (int64_t) instead of INT64_MAX? We already use that
> in GCC...
Yes, following patch also bootstraps:
--cut here--
Index: sreal.c
===================================================================
--- sreal.c (revision 217338)
+++ sreal.c (working copy)
@@ -156,7 +156,7 @@ sreal::to_int () const
if (m_exp <= -SREAL_BITS)
return 0;
if (m_exp >= SREAL_PART_BITS)
- return INT64_MAX;
+ return INTTYPE_MAXIMUM (int64_t);
if (m_exp > 0)
return m_sig << m_exp;
if (m_exp < 0)
--cut here--
Uros.
More information about the Gcc-patches
mailing list