diff --git a/src/search/lp/lp_internals.cc b/src/search/lp/lp_internals.cc index fa13ffc11d..1d17d005b2 100644 --- a/src/search/lp/lp_internals.cc +++ b/src/search/lp/lp_internals.cc @@ -16,6 +16,21 @@ #pragma GCC diagnostic ignored "-Wmisleading-indentation" #endif #endif + +/* + OSI uses the keyword 'register' which was deprecated for a while and removed + in C++ 17. Most compilers ignore it but clang 14 complains if it is still used. +*/ +#ifdef __GNUG__ +#if __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Wkeyword-macro" +#endif +#endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define register + #ifdef __clang__ #pragma GCC diagnostic ignored "-Wconstant-conversion" #endif diff --git a/src/search/lp/lp_solver.cc b/src/search/lp/lp_solver.cc index 691f14079d..d35d6db975 100644 --- a/src/search/lp/lp_solver.cc +++ b/src/search/lp/lp_solver.cc @@ -11,6 +11,21 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #endif + +/* + OSI uses the keyword 'register' which was deprecated for a while and removed + in C++ 17. Most compilers ignore it but clang 14 complains if it is still used. +*/ +#ifdef __GNUG__ +#if __GNUC__ >= 12 +#pragma GCC diagnostic ignored "-Wkeyword-macro" +#endif +#endif +#ifdef __clang__ +#pragma clang diagnostic ignored "-Wkeyword-macro" +#endif +#define register + #include #include #include