Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings #108

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions tests/src/ComparisonUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,25 @@ inline std::ostream& operator<<(std::ostream& os, const podio::RelationRange<T>&
return printContainer(os, range);
}

// Remove the -Wsign-compare warning because there are numbers in the
// EDM4hep EventHeader that are unsigned after https://github.com/key4hep/EDM4hep/pull/398
// and are signed for LCIO
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wsign-compare"
#else
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsign-compare"
#endif
template <typename T, typename U>
inline bool nanSafeComp(T x, U y) {
return (x == y) || (std::isnan(x) && std::isnan(y));
}
#ifdef __clang__
#pragma clang diagnostic pop
#else
#pragma GCC diagnostic pop
#endif

// Only enable for vectors
template <typename T, typename = void>
Expand Down