Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Forcefully disable warnings in GCC for <nv/target> #259

Merged
merged 3 commits into from
Mar 23, 2022

Conversation

wmaxey
Copy link
Member

@wmaxey wmaxey commented Mar 22, 2022

Currently GCC 6 and down produces this warning when compile with -Wpedantic

<source>:594:1: warning: ISO C++11 requires at least one argument for the "..." in a variadic macro
     )

While it's possible to ignore -Wpedantic, I believe it would be more reliable to silence warnings by marking the details of <nv/target> as system_headers.

@wmaxey wmaxey requested review from griwes and dkolsen-pgi March 22, 2022 23:49
@wmaxey wmaxey self-assigned this Mar 22, 2022
Copy link
Collaborator

@dkolsen-pgi dkolsen-pgi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clang seems to recognize and honor #pragma GCC system_header. (At least Clang 12 on Linux does.) Is the !defined(__clang__) necessary?

@wmaxey
Copy link
Member Author

wmaxey commented Mar 23, 2022

I would be willing to remove the condition, but it doesn't seem necessary as I haven't encountered warnings on Clang over this.

@dkolsen-pgi
Copy link
Collaborator

I am fine with the change as it is, even though I think it is cleaner without the Clang check. (NVC++ also defines __GNUC__, but you didn't exclude that compiler. I checked that NVC++ also recognizes and honors that pragma.)

@wmaxey wmaxey merged commit 281647c into main Mar 23, 2022
@wmaxey wmaxey deleted the bugfix/nv_target_pedantic_gcc branch March 23, 2022 20:48
@wmaxey wmaxey added this to the 1.8.1 milestone Mar 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants