mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 21:48:21 +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
22
src/Attr.cc
22
src/Attr.cc
|
@ -32,18 +32,21 @@ Attr::Attr(attr_tag t, IntrusivePtr<Expr> e)
|
|||
SetLocationInfo(&start_location, &end_location);
|
||||
}
|
||||
|
||||
Attr::Attr(::attr_tag t, IntrusivePtr<Expr> e) : Attr(static_cast<attr_tag>(t), e)
|
||||
Attr::Attr(attr_tag t)
|
||||
: Attr(t, nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
Attr::Attr(attr_tag t)
|
||||
: Attr(t, nullptr)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
Attr::Attr(::attr_tag t, IntrusivePtr<Expr> e) : Attr(static_cast<attr_tag>(t), e)
|
||||
{
|
||||
}
|
||||
|
||||
Attr::Attr(::attr_tag t) : Attr(static_cast<attr_tag>(t))
|
||||
{
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
Attr::~Attr() = default;
|
||||
|
||||
|
@ -243,11 +246,6 @@ const IntrusivePtr<Attr>& Attributes::Find(attr_tag t) const
|
|||
return Attr::nil;
|
||||
}
|
||||
|
||||
Attr* Attributes::FindAttr(::attr_tag t) const
|
||||
{
|
||||
return FindAttr(static_cast<attr_tag>(t));
|
||||
}
|
||||
|
||||
void Attributes::RemoveAttr(attr_tag t)
|
||||
{
|
||||
for ( auto it = attrs.begin(); it != attrs.end(); )
|
||||
|
@ -259,10 +257,18 @@ void Attributes::RemoveAttr(attr_tag t)
|
|||
}
|
||||
}
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
Attr* Attributes::FindAttr(::attr_tag t) const
|
||||
{
|
||||
return FindAttr(static_cast<attr_tag>(t));
|
||||
}
|
||||
|
||||
void Attributes::RemoveAttr(::attr_tag t)
|
||||
{
|
||||
RemoveAttr(static_cast<attr_tag>(t));
|
||||
}
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
void Attributes::Describe(ODesc* d) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue