-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Cleanup compiler warnings: unused variables/typedefs, uninitialised vars, etc. #2933
Conversation
@@ -23,7 +23,7 @@ namespace math { | |||
* <p>This function does not recover any memory from the computation. | |||
* | |||
*/ | |||
static void grad() { | |||
static inline void grad() { |
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.
This and the similar change in set_zero_all_adjoints_nested seem like they're different from the rest of the changes here - why do these functions become inline
?
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.
Static functions that aren't used in a given translation unit give an 'unused-function' warning, but this is suppressed if the static function is declared inline: https://sourceware.org/legacy-ml/gdb/2015-02/msg00064.html
These are small enough functions that I think inlining is fine imo
The latest set of changes seem good to me, I'd appreciate someone like @SteveBronder or @syclik giving it a once over before merging to make sure I'm not missing anything |
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.
lgtm!
@andrjohns THANK YOU!!! @WardBrian, thanks for reviewing! |
Summary
Cleans up the following compiler warnings:
Tests
No new tests, existing tests should pass
Side Effects
N/A
Release notes
Cleans up several compiler warnings throughout Math library and tests
Checklist
Math issue #(issue number)
Copyright holder: Andrew Johnson
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested