Skip to content

Commit 00e324d

Browse files
Extend noinline to gcc >= 12 to fix -Werror=maybe-uninitialized false positives in gcc 15 (#311)
A build failure can be reproduced with colcon's `--mixin coverage-gcc` (or `-DCMAKE_C_FLAGS='--coverage' -DCMAKE_CXX_FLAGS='--coverage'`) on Ubuntu 26.04, which has gcc 15.2.0 by default. Signed-off-by: Christophe Bedard <bedard.christophe@gmail.com>
1 parent dab0618 commit 00e324d

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

include/fastcdr/xcdr/optional.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class optional
9292

9393
//! Destructor
9494
~optional()
95-
#if defined(__GNUC__) && __GNUC__ == 12
95+
#if defined(__GNUC__) && __GNUC__ >= 12
9696
__attribute__(
9797
(noinline))
98-
#endif // if defined(__GNUC__) && __GNUC__ == 12
98+
#endif // if defined(__GNUC__) && __GNUC__ >= 12
9999
= default;
100100

101101
/*!
@@ -212,10 +212,10 @@ class optional
212212
//! Assigns content from an optional.
213213
optional& operator =(
214214
const optional& opt)
215-
#if defined(__GNUC__) && __GNUC__ == 12
215+
#if defined(__GNUC__) && __GNUC__ >= 12
216216
__attribute__(
217217
(noinline))
218-
#endif // if defined(__GNUC__) && __GNUC__ == 12
218+
#endif // if defined(__GNUC__) && __GNUC__ >= 12
219219
{
220220
reset();
221221
storage_.engaged_ = opt.storage_.engaged_;
@@ -229,10 +229,10 @@ class optional
229229
//! Assigns content from an optional.
230230
optional& operator =(
231231
optional&& opt)
232-
#if defined(__GNUC__) && __GNUC__ == 12
232+
#if defined(__GNUC__) && __GNUC__ >= 12
233233
__attribute__(
234234
(noinline))
235-
#endif // if defined(__GNUC__) && __GNUC__ == 12
235+
#endif // if defined(__GNUC__) && __GNUC__ >= 12
236236
{
237237
reset();
238238
storage_.engaged_ = opt.storage_.engaged_;

0 commit comments

Comments
 (0)