[flang-commits] [flang] [flang][AIX] Suppress AIX compat error (NFC) (PR #177174)

via flang-commits flang-commits at lists.llvm.org
Wed Jan 21 06:23:26 PST 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-semantics

Author: Kelvin Li (kkwli)

<details>
<summary>Changes</summary>

Suppress the following message

```
llvm-project/flang/include/flang/Evaluate/real.h:499:37: error: alignment of 16 bytes for a struct member is not binary compatible with IBM XL C/C++ for AIX 16.1.0 or older [-Werror,-Waix-compat]
  499 |   alignas(Word::alignment / 8) Word word_{}; // an Integer<>
      |                                     ^

```

---
Full diff: https://github.com/llvm/llvm-project/pull/177174.diff


1 Files Affected:

- (modified) flang/include/flang/Evaluate/real.h (+9) 


``````````diff
diff --git a/flang/include/flang/Evaluate/real.h b/flang/include/flang/Evaluate/real.h
index c0a966820d13e..391d4e057f134 100644
--- a/flang/include/flang/Evaluate/real.h
+++ b/flang/include/flang/Evaluate/real.h
@@ -30,6 +30,12 @@ namespace Fortran::evaluate::value {
 // LOG10(2.)*1E12
 static constexpr std::int64_t ScaledLogBaseTenOfTwo{301029995664};
 
+// Ignore error about requesting a large alignment not being ABI compatible
+// with older AIX systems.
+#if defined(_AIX)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waix-compat"
+#endif
 // Models IEEE binary floating-point numbers (IEEE 754-2008,
 // ISO/IEC/IEEE 60559.2011).  The first argument to this
 // class template must be (or look like) an instance of Integer<>;
@@ -498,6 +504,9 @@ template <typename WORD, int PREC> class Real {
   // by unaligned address.
   alignas(Word::alignment / 8) Word word_{}; // an Integer<>
 };
+#if defined(_AIX)
+#pragma GCC diagnostic pop
+#endif
 
 extern template class Real<Integer<16>, 11>; // IEEE half format
 extern template class Real<Integer<16>, 8>; // the "other" half format

``````````

</details>


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


More information about the flang-commits mailing list