-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't ignore GCC-specific warning under Clang #1557
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaronmondal thanks for this contribution, much appreciated! I'd like @miscco to also approve since I think he added this GCC ignore.
/ok to test |
160d085
to
2c8ca92
Compare
Clang doesn't know `-Wnon-template-friend`.
/ok to tset |
/ok to test |
@aaronmondal you don't have the permissions to do that |
/ok to test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks I hate it,
we have a special macro for that because it is so annoying
/merge |
Thanks! |
@@ -75,18 +75,19 @@ struct maybe_remove_property<PoolResource, | |||
Upstream, | |||
Property, | |||
cuda::std::enable_if_t<!cuda::has_property<Upstream, Property>>> { | |||
#ifdef __GNUC__ // GCC warns about compatibility issues with pre ISO C++ code | |||
#if defined(__GNUC__) && !defined(__clang__) // GCC warns about compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thought of this: Under what circumstances are __GNUC__
and __clang__
both defined? They must be or we wouldn't need this logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__GNUC__
means "compatibility with GNU C". This is defined by both GCC and Clang.__clang__
means Clang. I'd guess that this is also defined by clang derivatives such as HIPCC and DPC++. But it's not defined by GCC.- AFAIK GCC doesn't have a similar macro. I.e. there is no
__gcc__
macro.
Under what circumstances are
__GNUC__
and__clang__
both defined?
When you run a compilation with clang this is the case.
The "-Wnon-template-friend"
exists in GCC, but not in Clang. With the way things are now we're essentially saying: If you're a GNU C compatible compiler, but you're not Clang (or a Clang derivative where we can expect warning flags to be reasonably similar to clang), then add -Wnon-template-friend
to the ignorelist.
Before this patch Clang triggered warnings like warning: ignoring unknown warning
which spammed the logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the informative answer!
Clang doesn't know
-Wnon-template-friend
.