Skip to content

Commit dab0618

Browse files
authored
Fix -Werror=maybe-uninitialized in QCC 12.2.0 (#309)
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
1 parent 9e74964 commit dab0618

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

include/fastcdr/xcdr/optional.hpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ class optional
9191
}
9292

9393
//! Destructor
94-
~optional() = default;
94+
~optional()
95+
#if defined(__GNUC__) && __GNUC__ == 12
96+
__attribute__(
97+
(noinline))
98+
#endif // if defined(__GNUC__) && __GNUC__ == 12
99+
= default;
95100

96101
/*!
97102
* @brief Constructs the contained value in-place
@@ -224,6 +229,10 @@ class optional
224229
//! Assigns content from an optional.
225230
optional& operator =(
226231
optional&& opt)
232+
#if defined(__GNUC__) && __GNUC__ == 12
233+
__attribute__(
234+
(noinline))
235+
#endif // if defined(__GNUC__) && __GNUC__ == 12
227236
{
228237
reset();
229238
storage_.engaged_ = opt.storage_.engaged_;

0 commit comments

Comments
 (0)