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

MAINT: special: Fix a few warnings that occur when compiling the cephes code. #10018

Merged
merged 1 commit into from Apr 5, 2019

Conversation

@WarrenWeckesser
Copy link
Member

WarrenWeckesser commented Apr 4, 2019

  • Removed the unused variable err in the function hyp2f1_neg_c_equal_bc
    in hyp2f1.c to fix:

    scipy/special/cephes/hyp2f1.c:607:12: warning: unused variable 'err' [-Wunused-variable]
        double err;
               ^
    
  • Removed the unused function prototype for igam_leading_factor in igam.c
    to fix:

    scipy/special/cephes/igam.c:123:15: warning: unused function 'igam_leading_factor' [-Wunused-function]
    static double igam_leading_factor(double, double);
                  ^
    
  • Add a cast of code to unsigned long in the function mtherr in mtherr.c
    to fix:

    scipy/special/cephes/mtherr.c:83:27: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
        if (code <= 0 || code >= sizeof(conv_to_sf) / sizeof(conv_to_sf[0])) {
                         ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • Add const qualifiers where needed in the functions in polevl.h to fix
    several warnings of the form:

    scipy/special/cephes/expn.c:216:28: warning: passing 'const double *' to parameter of type 'double *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            term = fac*polevl(lambda, A[k], Adegs[k]);
                                      ^~~~
    scipy/special/cephes/polevl.h:67:50: note: passing argument to parameter 'coef' here
    static NPY_INLINE double polevl(double x, double coef[], int N)
    
…es code.

* Removed the unused variable `err` in the function `hyp2f1_neg_c_equal_bc`
  in hyp2f1.c to fix:

      scipy/special/cephes/hyp2f1.c:607:12: warning: unused variable 'err' [-Wunused-variable]
          double err;
                 ^

* Removed the unused function prototype for `igam_leading_factor` in igam.c
  to fix:

      scipy/special/cephes/igam.c:123:15: warning: unused function 'igam_leading_factor' [-Wunused-function]
      static double igam_leading_factor(double, double);
                    ^

* Add a cast of `code` to `unsigned long` in the function `mtherr` in mtherr.c
  to fix:

      scipy/special/cephes/mtherr.c:83:27: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
          if (code <= 0 || code >= sizeof(conv_to_sf) / sizeof(conv_to_sf[0])) {
                           ~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Add `const` qualifiers where needed in the functions in polevl.h to fix
  several warnings of the form:

      scipy/special/cephes/expn.c:216:28: warning: passing 'const double *' to parameter of type 'double *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
              term = fac*polevl(lambda, A[k], Adegs[k]);
                                        ^~~~
      scipy/special/cephes/polevl.h:67:50: note: passing argument to parameter 'coef' here
      static NPY_INLINE double polevl(double x, double coef[], int N)
@WarrenWeckesser

This comment has been minimized.

Copy link
Member Author

WarrenWeckesser commented Apr 5, 2019

The pypy3 build log shows that the tests were running, but were terminated after 90% with the message

Too long with no output (exceeded 10m0s)

I don't think that is related to this pull request.

@rgommers

This comment has been minimized.

Copy link
Member

rgommers commented Apr 5, 2019

pypy3 timeout I've seen before, indeed unrelated - best to just ignore it

@rgommers

This comment has been minimized.

Copy link
Member

rgommers commented Apr 5, 2019

All green and a straightforward improvement, so merging. Thanks @WarrenWeckesser

@rgommers rgommers merged commit e93619c into scipy:master Apr 5, 2019
9 of 10 checks passed
9 of 10 checks passed
ci/circleci: pypy3 Your tests failed on CircleCI
Details
ci/circleci: build_docs Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
scipy.scipy Build #20190405.1 succeeded
Details
scipy.scipy (Linux_Python_36_32bit_full) Linux_Python_36_32bit_full succeeded
Details
scipy.scipy (Windows Python35-64bit-full) Windows Python35-64bit-full succeeded
Details
scipy.scipy (Windows Python36-32bit-full) Windows Python36-32bit-full succeeded
Details
scipy.scipy (Windows Python36-64bit-full) Windows Python36-64bit-full succeeded
Details
scipy.scipy (Windows Python37-64bit-full) Windows Python37-64bit-full succeeded
Details
@rgommers rgommers added this to the 1.3.0 milestone Apr 5, 2019
@WarrenWeckesser WarrenWeckesser deleted the WarrenWeckesser:fix-warnings branch Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.