Skip to content
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

ifdef out remaining printf statements #526

Merged
merged 2 commits into from
Apr 22, 2017

Conversation

wds15
Copy link
Contributor

@wds15 wds15 commented Apr 21, 2017

Submission Checklist

  • Run unit tests: ./runTests.py test/unit
  • Run cpplint: make cpplint
  • Declare copyright holder and open-source license: see below

Summary:

disables printf functions from CVODES by wrapping them in ifdef blocks controlled by NO_FPRINTF_OUTPUT

Intended Effect:

make CRAN happy which forbids any printf calls in binaries (even if they are not called).

closes #524

How to Verify:

build cvodes and then

cd lib/cvodes_2.9.0
grep -R -F -n -w "printf" .

this should not show any of the binary files pop up.

Side Effects:

Documentation:

Reviewer Suggestions:

@bgoodri

Copyright and Licensing

Please list the copyright holder for the work you are submitting (this will be you or your assignee, such as a university or company): Sebastian Weber

By submitting this pull request, the copyright holder is requiring to license the submitted work under the following licenses:

Copy link
Contributor

@bob-carpenter bob-carpenter left a comment

Choose a reason for hiding this comment

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

I think you need to move the initial ifndef above the variable declarations to avoid a bunch of unused variable warnings when NO-FPRINTF_OUTPUT is specified. Otherwise, it looks OK.

The warnings won't trigger if we never instantiate these functions, but I think the code will be cleaner above the vars anyway.

@@ -270,6 +270,7 @@ void N_VPrint_Serial(N_Vector x)
long int i, N;
realtype *xd;

#ifndef NO_FPRINTF_OUTPUT
Copy link
Contributor

Choose a reason for hiding this comment

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

This ifndef should go above the variables or you're going to trigger a bunch of unused variable warnings.

This seems to be a pattern in all of these, but I'm only mentioning it once here.

@wds15
Copy link
Contributor Author

wds15 commented Apr 22, 2017

Thanks Bob. Should be fixed now.

@bob-carpenter bob-carpenter merged commit 5eac079 into develop Apr 22, 2017
@bob-carpenter bob-carpenter deleted the bugfix/issue-524-cvodes-printf branch April 22, 2017 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

printf from CVODES again
2 participants