-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
STY: reduce number of C compiler warnings #3537
Conversation
The PR looks OK to me because the changes in fftpack and quadpack seem to be only in the python interfaces, and I think scipy has effectively forked cephes, so changes within this cephes code itself (not just interface) should be OK too. |
@larsmans thanks, this kind of PR is quite useful imho. |
I didn't touch any of the Fortran code because I'm not familiar with that language, but |
@@ -482,7 +482,7 @@ double *loss; /* estimates loss of significance */ | |||
a = f; | |||
} | |||
|
|||
ia = round(a); | |||
round(a); /* XXX result not used, why? */ |
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 should be resolved before merging. I suspect the line can be deleted. @pv?
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.
The ia = ...; ib = ...
is just copypaste from other routines.
The statement should be removed completely if unused.
Thanks for working on this! 5% fewer warnings is a great start. I don't think the change in special/cephes/euclid.c is necessary, because the entire file is not used. I just built scipy with the file removed, and had no problem with the build or the tests. |
@WarrenWeckesser I was wondering what that |
The question is if we want to bother hooking up |
@@ -61,6 +61,7 @@ | |||
|
|||
int merror = 0; | |||
|
|||
#if 0 /* unused */ |
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.
Go ahead and delete it. Having #if 0
stuff around is not good.
Ok, pushed a new version. Also rebased on current master. |
Removed the Cephes rational arithmetic functions (euclid.c), which were entirely unused. Also dead statements, non-prototype (K&R) declarations. Reduces warning log by exactly 300 lines on my box.
Changes Unknown when pulling c1e9d1d on larsmans:warnings into * on scipy:master*. |
👍 |
STY: reduce number of C compiler warnings
LGTM, merged |
Mostly dead code, unused variables, non-prototype (K&R) declarations. The
special/cephes
dir in particular contains some very old-fashioned C code. (It also carries no license...)Reduces warning log by exactly 300 lines on my box, or ~5%.