Silence compiler warnings related to deprecated TYPE_COUNTER

This commit is contained in:
Jon Siwek 2020-08-03 16:55:52 -07:00
parent 22b401f52f
commit f1b0d9a8f0
2 changed files with 15 additions and 0 deletions

View file

@ -1542,6 +1542,10 @@ bool same_type(const Type& arg_t1, const Type& arg_t2,
case TYPE_BOOL: case TYPE_BOOL:
case TYPE_INT: case TYPE_INT:
case TYPE_COUNT: case TYPE_COUNT:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
case TYPE_COUNTER:
#pragma GCC diagnostic pop
case TYPE_DOUBLE: case TYPE_DOUBLE:
case TYPE_TIME: case TYPE_TIME:
case TYPE_INTERVAL: case TYPE_INTERVAL:
@ -1743,6 +1747,10 @@ bool is_assignable(TypeTag t)
case TYPE_BOOL: case TYPE_BOOL:
case TYPE_INT: case TYPE_INT:
case TYPE_COUNT: case TYPE_COUNT:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
case TYPE_COUNTER:
#pragma GCC diagnostic pop
case TYPE_DOUBLE: case TYPE_DOUBLE:
case TYPE_TIME: case TYPE_TIME:
case TYPE_INTERVAL: case TYPE_INTERVAL:

View file

@ -97,6 +97,10 @@ constexpr InternalTypeTag to_internal_type_tag(TypeTag tag) noexcept
return TYPE_INTERNAL_INT; return TYPE_INTERNAL_INT;
case TYPE_COUNT: case TYPE_COUNT:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
case TYPE_COUNTER:
#pragma GCC diagnostic pop
case TYPE_PORT: case TYPE_PORT:
return TYPE_INTERNAL_UNSIGNED; return TYPE_INTERNAL_UNSIGNED;
@ -936,8 +940,11 @@ constexpr auto TYPE_BOOL = zeek::TYPE_BOOL;
constexpr auto TYPE_INT = zeek::TYPE_INT; constexpr auto TYPE_INT = zeek::TYPE_INT;
[[deprecated("Remove in v4.1. Use zeek::TYPE_COUNT instead.")]] [[deprecated("Remove in v4.1. Use zeek::TYPE_COUNT instead.")]]
constexpr auto TYPE_COUNT = zeek::TYPE_COUNT; constexpr auto TYPE_COUNT = zeek::TYPE_COUNT;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
[[deprecated("Remove in v4.1. TYPE_COUNTER was removed. Use zeek::TYPE_COUNT instead.")]] [[deprecated("Remove in v4.1. TYPE_COUNTER was removed. Use zeek::TYPE_COUNT instead.")]]
constexpr auto TYPE_COUNTER = zeek::TYPE_COUNTER; constexpr auto TYPE_COUNTER = zeek::TYPE_COUNTER;
#pragma GCC diagnostic pop
[[deprecated("Remove in v4.1. Use zeek::TYPE_DOUBLE instead.")]] [[deprecated("Remove in v4.1. Use zeek::TYPE_DOUBLE instead.")]]
constexpr auto TYPE_DOUBLE = zeek::TYPE_DOUBLE; constexpr auto TYPE_DOUBLE = zeek::TYPE_DOUBLE;
[[deprecated("Remove in v4.1. Use zeek::TYPE_TIME instead.")]] [[deprecated("Remove in v4.1. Use zeek::TYPE_TIME instead.")]]