[flang-commits] [flang] [Flang][Runtime] Fix implicit conversion warning when targeting 32bit… (PR #99465)

via flang-commits flang-commits at lists.llvm.org
Fri Jul 19 09:33:19 PDT 2024


================
@@ -23,10 +23,14 @@ 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);
----------------
jeanPerier wrote:

nit: use braces init
In the runtime the style follows flang front-end coding style: https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md

The whole point of using braces init is to get warning when narrowing like it was the case so that we can asses and discuss these situation.

https://github.com/llvm/llvm-project/pull/99465


More information about the flang-commits mailing list