Skip to content

Commit

Permalink
Build: ignore g++ 11 array bound false positive.
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidWallOfCode committed Jul 13, 2023
1 parent cbaf246 commit e73e88f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions code/include/swoc/TextView.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
#include "swoc/swoc_version.h"
#include "swoc/string_view_util.h"

// For no apparent reason, g++ 11 complains about array bound violations with either suffix_at or
// assign, the error message is too vague for me to be sure - it doesn't even provide the location of
// the method invocation. I've been using g++ 12 for development and I don't see that error.
#if __GNUC__ == 11
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Warray-bounds"
#endif

namespace swoc { inline namespace SWOC_VERSION_NS {

class TextView;
Expand Down Expand Up @@ -903,6 +911,14 @@ class TextView : public std::string_view {
}
};

struct CaselessEqual {
/// @return @c true if the strings are the same sans case.
bool
operator()(self_type const& lhs, self_type const& rhs) const noexcept {

}
};

/** A pointer to the first byte.
*
* @return Address of the first byte of the view.
Expand Down Expand Up @@ -2036,3 +2052,7 @@ template <> struct hash<swoc::TextView> {
/// @endcond

} // namespace std

#if __GNUC__ == 11
# pragma GCC diagnostic pop
#endif

0 comments on commit e73e88f

Please sign in to comment.