Disable some deprecation diagnostics for GCC

Clang automatically disables deprecation warnings for types used within
already-deprecated contexts, such as if you use a deprecated type inside
of a method that's beeen marked as deprecated. GCC doesn't have this
feature so it spews a lot more warnings. These functions are now wrapped
in pragmas that disable the warnings for the usage.
This commit is contained in:
Tim Wojtulewicz 2020-06-11 15:43:11 -07:00
parent 137e416a03
commit 149e3b3c32
19 changed files with 275 additions and 135 deletions

View file

@ -25,6 +25,8 @@ struct FieldMapping {
FieldMapping(const std::string& arg_name, const zeek::TypeTag& arg_type, int arg_position);
FieldMapping(const std::string& arg_name, const zeek::TypeTag& arg_type, const zeek::TypeTag& arg_subtype, int arg_position);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
[[deprecated("Remove in v4.1. Use the version that takes zeek:TypeTag.")]]
FieldMapping(const std::string& arg_name, const ::TypeTag& arg_type, int arg_position)
: FieldMapping(arg_name, static_cast<zeek::TypeTag>(arg_type), arg_position)
@ -34,6 +36,7 @@ struct FieldMapping {
FieldMapping(const std::string& arg_name, const ::TypeTag& arg_type, const ::TypeTag& arg_subtype, int arg_position)
: FieldMapping(arg_name, static_cast<zeek::TypeTag>(arg_type), static_cast<zeek::TypeTag>(arg_subtype), arg_position)
{}
#pragma GCC diagnostic pop
FieldMapping(const FieldMapping& arg);
FieldMapping() { position = -1; secondary_position = -1; }