From 6db2465ce74141f378a290cfa3b56eb69dc379cb Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Sun, 21 Jul 2024 18:57:56 +0000 Subject: [PATCH] =?UTF-8?q?[Flang][Runtime]=20Fix=20implicit=20conversion?= =?UTF-8?q?=20warning=20when=20targeting=2032bit=E2=80=A6=20(#99465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit … architecture On 32 bit systems, TypeParameterValue is 64bit wide while CFI_index_t is 32bit wide. --- flang/runtime/derived.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/flang/runtime/derived.cpp b/flang/runtime/derived.cpp index 0d9e033df4e27..659f54fa344bb 100644 --- a/flang/runtime/derived.cpp +++ b/flang/runtime/derived.cpp @@ -23,10 +23,9 @@ static RT_API_ATTRS void GetComponentExtents(SubscriptValue (&extents)[maxRank], const typeInfo::Component &comp, const Descriptor &derivedInstance) { const typeInfo::Value *bounds{comp.bounds()}; for (int dim{0}; dim < comp.rank(); ++dim) { - SubscriptValue lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)}; - SubscriptValue ub{ - bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)}; - extents[dim] = ub >= lb ? ub - lb + 1 : 0; + auto lb{bounds[2 * dim].GetValue(&derivedInstance).value_or(0)}; + auto ub{bounds[2 * dim + 1].GetValue(&derivedInstance).value_or(0)}; + extents[dim] = ub >= lb ? static_cast(ub - lb + 1) : 0; } }