Skip to content

Commit

Permalink
Suppressing erroneous warning for C++14.
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Sep 17, 2024
1 parent e794467 commit 398b0ed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/comms/CompileControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
#define COMMS_IS_GCC_11 (COMMS_IS_GCC && (__GNUC__ == 11))
#define COMMS_IS_GCC_11_OR_ABOVE (COMMS_IS_GCC && (__GNUC__ >= 11))
#define COMMS_IS_GCC_12 (COMMS_IS_GCC && (__GNUC__ == 12))
#define COMMS_IS_GCC_14 (COMMS_IS_GCC && (__GNUC__ == 14))
#define COMMS_IS_CLANG_7_OR_ABOVE (COMMS_IS_CLANG && (__clang_major__ >= 7))
#define COMMS_IS_CLANG_8 (COMMS_IS_CLANG && (__clang_major__ == 8))
#define COMMS_IS_CLANG_8_OR_BELOW (COMMS_IS_CLANG && (__clang_major__ <= 8))
Expand Down
10 changes: 10 additions & 0 deletions include/comms/util/access.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@
#include <limits>
#include <iterator>

#include "comms/CompileControl.h"
#include "comms/util/type_traits.h"
#include "comms/details/tag.h"

COMMS_GNU_WARNING_PUSH

#if COMMS_IS_GCC_14 && defined(NDEBUG) && (COMMS_IS_CPP20 || COMMS_IS_CPP23)
// Bug in gcc-14, reporting "free-nonheap-object" error when working with vectors and using C++20/23, but only in Release mode
COMMS_GNU_WARNING_DISABLE("-Wfree-nonheap-object")
#endif // #if COMMS_IS_GCC_14 && defined(NDEBUG) && (COMMS_IS_CPP20 || COMMS_IS_CPP23)

namespace comms
{

Expand Down Expand Up @@ -813,3 +821,5 @@ T readData(TIter& iter, std::size_t size, const traits::endian::Little& endian)
} // namespace util

} // namespace comms

COMMS_GNU_WARNING_POP

0 comments on commit 398b0ed

Please sign in to comment.