Skip to content

Commit e2d74c7

Browse files
committed
Silence spurious GCC 8 warning
For an unknown reason GCC 8 thinks is_float is never used.
1 parent 15bf514 commit e2d74c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/java_bytecode/expr2java.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ std::string type2java(const typet &type, const namespacet &ns);
5858
template <typename float_type>
5959
std::string floating_point_to_java_string(float_type value)
6060
{
61-
const auto is_float = std::is_same<float_type, float>::value;
61+
static const auto is_float = std::is_same<float_type, float>::value;
62+
(void)is_float; // silence a spurious warning generated by GCC 8
6263
static const std::string class_name = is_float ? "Float" : "Double";
6364
if(std::isnan(value))
6465
return class_name + ".NaN";

0 commit comments

Comments
 (0)