From 27d6a14f484b880d0bb83c86af94346c4a2d29cf Mon Sep 17 00:00:00 2001 From: Florian Pommerening Date: Wed, 1 Feb 2023 19:04:47 +0100 Subject: [PATCH] [trivial] Ignore use of former keyword register in OSI code. --- src/search/lp/lp_internals.cc | 15 +++++++++++++++ src/search/lp/lp_solver.cc | 15 +++++++++++++++ 2 files changed, 30 insertions(+) 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