Skip to content

Commit a94aa18

Browse files
authored
Fix various warnings (#4950)
1 parent 3fa57d6 commit a94aa18

File tree

6 files changed

+15
-2
lines changed

6 files changed

+15
-2
lines changed

ortools/math_opt/core/solver_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ class SolverInterface {
6262

6363
// All parameters that can't be exchanged with another process. The caller
6464
// keeps ownership of non_streamable.
65-
const NonStreamableSolverInitArguments* non_streamable = nullptr;
65+
const NonStreamableSolverInitArguments* absl_nullable non_streamable =
66+
nullptr;
6667
};
6768

6869
// A callback function (if non null) for messages emitted by the solver.

ortools/math_opt/cpp/BUILD.bazel

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,10 @@ cc_library(
927927
name = "remote_streaming_mode",
928928
srcs = ["remote_streaming_mode.cc"],
929929
hdrs = ["remote_streaming_mode.h"],
930-
deps = ["@abseil-cpp//absl/strings:string_view"],
930+
deps = [
931+
"@abseil-cpp//absl/base:core_headers",
932+
"@abseil-cpp//absl/strings:string_view",
933+
],
931934
)
932935

933936
cc_test(

ortools/math_opt/cpp/remote_streaming_mode.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <ostream>
1717
#include <string>
1818

19+
#include "absl/base/optimization.h"
1920
#include "absl/strings/string_view.h"
2021

2122
namespace operations_research::math_opt {
@@ -29,6 +30,7 @@ std::string AbslUnparseFlag(const RemoteStreamingSolveMode value) {
2930
case RemoteStreamingSolveMode::kInProcess:
3031
return "inprocess";
3132
}
33+
ABSL_UNREACHABLE();
3234
}
3335

3436
bool AbslParseFlag(const absl::string_view text,

ortools/math_opt/elemental/codegen/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ cc_library(
3434
hdrs = ["gen_c.h"],
3535
deps = [
3636
":gen",
37+
"@abseil-cpp//absl/base:core_headers",
3738
"@abseil-cpp//absl/log:check",
3839
"@abseil-cpp//absl/strings",
3940
"@abseil-cpp//absl/strings:str_format",
@@ -54,6 +55,7 @@ cc_library(
5455
hdrs = ["gen_python.h"],
5556
deps = [
5657
":gen",
58+
"@abseil-cpp//absl/base:core_headers",
5759
"@abseil-cpp//absl/strings",
5860
"@abseil-cpp//absl/strings:str_format",
5961
"@abseil-cpp//absl/strings:string_view",

ortools/math_opt/elemental/codegen/gen_c.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <memory>
1717
#include <string>
1818

19+
#include "absl/base/optimization.h"
1920
#include "absl/log/check.h"
2021
#include "absl/strings/ascii.h"
2122
#include "absl/strings/str_cat.h"
@@ -60,6 +61,7 @@ absl::string_view GetCTypeName(
6061
case CodegenAttrTypeDescriptor::ValueType::kDouble:
6162
return "double";
6263
}
64+
ABSL_UNREACHABLE();
6365
}
6466

6567
// Turns an element/attribute name (e.g. "some_name") into a camel case name

ortools/math_opt/elemental/codegen/gen_python.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <set>
1818
#include <string>
1919

20+
#include "absl/base/optimization.h"
2021
#include "absl/strings/ascii.h"
2122
#include "absl/strings/str_cat.h"
2223
#include "absl/strings/str_format.h"
@@ -55,6 +56,7 @@ absl::string_view GetAttrPyValueType(
5556
case CodegenAttrTypeDescriptor::ValueType::kDouble:
5657
return "float";
5758
}
59+
ABSL_UNREACHABLE();
5860
}
5961

6062
// Returns the python type for the given value type.
@@ -68,6 +70,7 @@ absl::string_view GetAttrNumpyValueType(
6870
case CodegenAttrTypeDescriptor::ValueType::kDouble:
6971
return "np.float64";
7072
}
73+
ABSL_UNREACHABLE();
7174
}
7275

7376
class PythonEnumsGenerator : public CodeGenerator {

0 commit comments

Comments
 (0)