Skip to content

[CLN] [BLD] Fix many compiler warnings #22013

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

Merged
merged 5 commits into from
Jul 24, 2018
Merged

Conversation

jbrockmendel
Copy link
Member

Checked in OSX in 2.7 and 3.7, on Ubuntu on 2.7 and 3.5, this fixes just about all the warnings that are fixable at my pay-grade.

The ones that are left:

  • Ubiquitous NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION --> I expect there is a compiler flag that can be set in setup.py to silence this (and only this) warning, haven't figured it out.
  • In Py3.7:
pandas/_libs/src/ujson/python/objToJSON.c:430:15: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
        char *data = PyUnicode_AsUTF8AndSize(obj, &len);
              ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pandas/_libs/src/ujson/python/objToJSON.c:436:14: warning: 'PyUnicode_EncodeUTF8' is deprecated [-Wdeprecated-declarations]
    newObj = PyUnicode_EncodeUTF8(PyUnicode_AS_UNICODE(obj),
             ^
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m/unicodeobject.h:1324:7: note: 'PyUnicode_EncodeUTF8' has been
      explicitly marked deprecated here
    ) Py_DEPRECATED(3.3);
      ^
/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m/pyport.h:493:54: note: expanded from macro 'Py_DEPRECATED'
#define Py_DEPRECATED(VERSION_UNUSED) __attribute__((__deprecated__))
                                                     ^
3 warnings generated.
  • On Linux:
In file included from pandas/_libs/src/datetime/np_datetime.h:21:0,
                 from pandas/_libs/src/datetime/np_datetime_strings.c:33:
/usr/include/python3.5m/datetime.h:191:25: warning: ‘PyDateTimeAPI’ defined but not used [-Wunused-variable]
 static PyDateTime_CAPI *PyDateTimeAPI = NULL;
  • Also on Linux a bunch of "this may be unitialized" warnings.

@codecov
Copy link

codecov bot commented Jul 22, 2018

Codecov Report

Merging #22013 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #22013   +/-   ##
=======================================
  Coverage   91.99%   91.99%           
=======================================
  Files         167      167           
  Lines       50578    50578           
=======================================
  Hits        46530    46530           
  Misses       4048     4048
Flag Coverage Δ
#multiple 90.4% <ø> (ø) ⬆️
#single 42.17% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67b6277...c19e7e5. Read the comment docs.

@gfyoung gfyoung added Build Library building on various platforms Clean labels Jul 23, 2018
@gfyoung gfyoung requested a review from jreback July 23, 2018 05:00
@jreback
Copy link
Contributor

jreback commented Jul 23, 2018

https://travis-ci.org/pandas-dev/pandas/jobs/406697012

was this just worse before? there are still many unsigned compare with signed warnings.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

see comments

@jbrockmendel
Copy link
Member Author

was this just worse before? there are still many unsigned compare with signed warnings.

Yes. The first commit here caused test failures (that I didn't get locally), so I reverted fixes in interval.pyx.

@jreback jreback added this to the 0.24.0 milestone Jul 24, 2018
@jreback jreback merged commit a439472 into pandas-dev:master Jul 24, 2018
@jreback
Copy link
Contributor

jreback commented Jul 24, 2018

ok let's hope this and your other PR fixes more warnings :>

@jbrockmendel jbrockmendel deleted the warnings branch July 24, 2018 00:19
Sup3rGeo pushed a commit to Sup3rGeo/pandas that referenced this pull request Oct 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms Clean
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants