[flang-commits] [flang] 1c8ba24 - [flang] Silence warning in release builds

David Spickett via flang-commits flang-commits at lists.llvm.org
Fri Apr 26 01:59:36 PDT 2024


Author: David Spickett
Date: 2024-04-26T09:59:24+01:00
New Revision: 1c8ba24da884b612125aafed98f67f41883dc24c

URL: https://github.com/llvm/llvm-project/commit/1c8ba24da884b612125aafed98f67f41883dc24c
DIFF: https://github.com/llvm/llvm-project/commit/1c8ba24da884b612125aafed98f67f41883dc24c.diff

LOG: [flang] Silence warning in release builds

/home/david.spickett/llvm-project/flang/include/flang/Runtime/descriptor.h:458:30: warning: variable 'addendum' set but not used [-Wunused-but-set-variable]
  458 |     if (DescriptorAddendum * addendum{descriptor().Addendum()}) {
      |

The if body is purely asserts.

Added: 
    

Modified: 
    flang/include/flang/Runtime/descriptor.h

Removed: 
    


################################################################################
diff  --git a/flang/include/flang/Runtime/descriptor.h b/flang/include/flang/Runtime/descriptor.h
index 96d56d9b43a62b..1b0b7e23ce6ccd 100644
--- a/flang/include/flang/Runtime/descriptor.h
+++ b/flang/include/flang/Runtime/descriptor.h
@@ -456,6 +456,7 @@ class alignas(Descriptor) StaticDescriptor {
     assert(descriptor().rank() <= maxRank);
     assert(descriptor().SizeInBytes() <= byteSize);
     if (DescriptorAddendum * addendum{descriptor().Addendum()}) {
+      (void)addendum;
       assert(hasAddendum);
       assert(addendum->LenParameters() <= maxLengthTypeParameters);
     } else {


        


More information about the flang-commits mailing list