mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
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:
parent
137e416a03
commit
149e3b3c32
19 changed files with 275 additions and 135 deletions
|
@ -33,10 +33,13 @@ struct Field {
|
|||
secondary_name(secondary_name ? copy_string(secondary_name) : nullptr),
|
||||
type(type), subtype(subtype), optional(optional) { }
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::TypeTag instead")]]
|
||||
Field(const char* name, const char* secondary_name, ::TypeTag type, ::TypeTag subtype, bool optional) :
|
||||
Field(name, secondary_name, static_cast<zeek::TypeTag>(type), static_cast<zeek::TypeTag>(subtype), optional)
|
||||
{}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
|
@ -150,10 +153,13 @@ struct Value {
|
|||
: type(arg_type), subtype(zeek::TYPE_VOID), present(arg_present)
|
||||
{}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::TypeTag.")]]
|
||||
Value(::TypeTag arg_type, bool arg_present = true)
|
||||
: Value(static_cast<zeek::TypeTag>(arg_type), arg_present)
|
||||
{}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
@ -169,10 +175,13 @@ struct Value {
|
|||
: type(arg_type), subtype(arg_subtype), present(arg_present)
|
||||
{}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
[[deprecated("Remove in v4.1. Use the version that takes zeek::TypeTag.")]]
|
||||
Value(::TypeTag arg_type, ::TypeTag arg_subtype, bool arg_present = true)
|
||||
: Value(static_cast<zeek::TypeTag>(arg_type), static_cast<zeek::TypeTag>(arg_subtype), arg_present)
|
||||
{}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue