diff --git a/ortools/math_opt/core/solver_interface.h b/ortools/math_opt/core/solver_interface.h index 6fc3f8dfad..845a7f1f11 100644 --- a/ortools/math_opt/core/solver_interface.h +++ b/ortools/math_opt/core/solver_interface.h @@ -62,7 +62,8 @@ class SolverInterface { // All parameters that can't be exchanged with another process. The caller // keeps ownership of non_streamable. - const NonStreamableSolverInitArguments* non_streamable = nullptr; + const NonStreamableSolverInitArguments* absl_nullable non_streamable = + nullptr; }; // A callback function (if non null) for messages emitted by the solver. diff --git a/ortools/math_opt/cpp/BUILD.bazel b/ortools/math_opt/cpp/BUILD.bazel index 6c1e4d8890..762002f206 100644 --- a/ortools/math_opt/cpp/BUILD.bazel +++ b/ortools/math_opt/cpp/BUILD.bazel @@ -927,7 +927,10 @@ cc_library( name = "remote_streaming_mode", srcs = ["remote_streaming_mode.cc"], hdrs = ["remote_streaming_mode.h"], - deps = ["@abseil-cpp//absl/strings:string_view"], + deps = [ + "@abseil-cpp//absl/base:core_headers", + "@abseil-cpp//absl/strings:string_view", + ], ) cc_test( diff --git a/ortools/math_opt/cpp/remote_streaming_mode.cc b/ortools/math_opt/cpp/remote_streaming_mode.cc index bcc8b0873e..8c2ff05710 100644 --- a/ortools/math_opt/cpp/remote_streaming_mode.cc +++ b/ortools/math_opt/cpp/remote_streaming_mode.cc @@ -16,6 +16,7 @@ #include #include +#include "absl/base/optimization.h" #include "absl/strings/string_view.h" namespace operations_research::math_opt { @@ -29,6 +30,7 @@ std::string AbslUnparseFlag(const RemoteStreamingSolveMode value) { case RemoteStreamingSolveMode::kInProcess: return "inprocess"; } + ABSL_UNREACHABLE(); } bool AbslParseFlag(const absl::string_view text, diff --git a/ortools/math_opt/elemental/codegen/BUILD.bazel b/ortools/math_opt/elemental/codegen/BUILD.bazel index bf6d9c59b4..8977470617 100644 --- a/ortools/math_opt/elemental/codegen/BUILD.bazel +++ b/ortools/math_opt/elemental/codegen/BUILD.bazel @@ -34,6 +34,7 @@ cc_library( hdrs = ["gen_c.h"], deps = [ ":gen", + "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/log:check", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", @@ -54,6 +55,7 @@ cc_library( hdrs = ["gen_python.h"], deps = [ ":gen", + "@abseil-cpp//absl/base:core_headers", "@abseil-cpp//absl/strings", "@abseil-cpp//absl/strings:str_format", "@abseil-cpp//absl/strings:string_view", diff --git a/ortools/math_opt/elemental/codegen/gen_c.cc b/ortools/math_opt/elemental/codegen/gen_c.cc index 3b7b3768ad..0a1c3ca688 100644 --- a/ortools/math_opt/elemental/codegen/gen_c.cc +++ b/ortools/math_opt/elemental/codegen/gen_c.cc @@ -16,6 +16,7 @@ #include #include +#include "absl/base/optimization.h" #include "absl/log/check.h" #include "absl/strings/ascii.h" #include "absl/strings/str_cat.h" @@ -60,6 +61,7 @@ absl::string_view GetCTypeName( case CodegenAttrTypeDescriptor::ValueType::kDouble: return "double"; } + ABSL_UNREACHABLE(); } // Turns an element/attribute name (e.g. "some_name") into a camel case name diff --git a/ortools/math_opt/elemental/codegen/gen_python.cc b/ortools/math_opt/elemental/codegen/gen_python.cc index bd23aae40d..c01cb6742a 100644 --- a/ortools/math_opt/elemental/codegen/gen_python.cc +++ b/ortools/math_opt/elemental/codegen/gen_python.cc @@ -17,6 +17,7 @@ #include #include +#include "absl/base/optimization.h" #include "absl/strings/ascii.h" #include "absl/strings/str_cat.h" #include "absl/strings/str_format.h" @@ -55,6 +56,7 @@ absl::string_view GetAttrPyValueType( case CodegenAttrTypeDescriptor::ValueType::kDouble: return "float"; } + ABSL_UNREACHABLE(); } // Returns the python type for the given value type. @@ -68,6 +70,7 @@ absl::string_view GetAttrNumpyValueType( case CodegenAttrTypeDescriptor::ValueType::kDouble: return "np.float64"; } + ABSL_UNREACHABLE(); } class PythonEnumsGenerator : public CodeGenerator {