-
Notifications
You must be signed in to change notification settings - Fork 99
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
Remove Unused Parameter Warnings #417
Remove Unused Parameter Warnings #417
Conversation
Comment out parameter names in function definitions to avoid `-Wunused-parameter` warnings. If their use is hidden behind an #ifdef, use an #else block to avoid the warning appropriately.
BTW, I'm also seeing these warnings, but I can't manage to get rid of them. Hopefully you know what to do about them.
|
Ping. |
@jmgate : Last week was a blur with our user group meeting. We will take care of this. |
pong ~ let me see what happens. Give me a few days. |
No worries. Just wanted to make sure the right person had seen it. |
@kyungjoo-kim is THE right person ... :) |
@jmgate It is a header file for function declaration. Can you give me the full stack of messages ? Which compiling file create that error ? |
|
@jmgate I figured out where the warning is from. Do I submit a separate PR or I can just work on in this PR ? |
You should be able to push more commits to this branch on my fork. If you run into a permissions issue, let me know. |
@jmgate Done. |
Thanks @kyungjoo-kim. You want to review and approve this PR then? |
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.
Looks legit.
Should I be doing anything else to help this get merged? |
I merged develop back into this branch, fixed a conflict and updated the Spot-check run on kokkos-dev-2, all test pass:
Merging this in, thanks @jmgate ! |
I've come across a number of unused parameter warnings in kokkos-kernels in Trilinos using gcc-7.3.0 and compiling with
-Wall -Wextra -Wpedantic
. Where possible, I've commented out parameter names in function definitions to avoid-Wunused-parameter
warnings. If you'd prefer to have the parameter names removed entirely, feel free to do so. If the use of a given parameter is hidden behind an#ifdef
, I've used an#else
block and(void)parameterName;
statements to avoid the warnings instead. If you don't like that, you might want something along these lines instead:Essentially you can pull the
#if
outside the function rather than keeping it inside.These changes build fine for me within Trilinos, but I haven't built/tested kokkos-kernels by itself. I don't expect any issues.