Error on C Warnings
State: closed

Using Clang and latest numpy locally looks like we can use `-Werror`. WIP as I think there may still be things with gcc and older numpy versions to sort out

Note that there is also a warning emitted by cython for unreachable code in groupby, but -Werror wouldn't affect the "cythonization" step.


Labels:
name: Build
description: Library building on various platforms

Comments:
on the py37 builds

```
In file included from pandas/_libs/src/ujson/python/date_conversions.h:7:0,
                 from pandas/_libs/src/ujson/python/date_conversions.c:4:
/home/vsts/miniconda3/envs/pandas-dev/include/python3.7m/datetime.h:204:25: error: ‘PyDateTimeAPI’ defined but not used [-Werror=unused-variable]
 static PyDateTime_CAPI *PyDateTimeAPI = NULL;
                         ^
cc1: all warnings being treated as errors
```

is this something we can handle on our end?
> on the py37 builds
> 
> ```
> In file included from pandas/_libs/src/ujson/python/date_conversions.h:7:0,
>                  from pandas/_libs/src/ujson/python/date_conversions.c:4:
> /home/vsts/miniconda3/envs/pandas-dev/include/python3.7m/datetime.h:204:25: error: ‘PyDateTimeAPI’ defined but not used [-Werror=unused-variable]
>  static PyDateTime_CAPI *PyDateTimeAPI = NULL;
>                          ^
> cc1: all warnings being treated as errors
> ```
> 
> is this something we can handle on our end?

Potentially missing the PyDateTime_IMPORT macro which should initialise this. https://docs.python.org/3/c-api/datetime.html#datetime-objects
Yea that and `get_blkno_indexers` throws a lot of errors in GCC. Haven't been able to figure those out yet but getting close...
I think the issue here in internals might be a problem with the code Cython generates for generator functions. I opened https://github.com/cython/cython/issues/3430 there so will see (@MomIsBestFriend I believe you were looking at that as well)
OK this should be ready for review. w.r.t. the internals change I ran benchmarks for concat and reshape again and got the following:

```sh
       before           after         ratio
     [80078ac0]       [5fc220c0]
     <master>         <no-warnings>
-      3.81±0.2ms      3.18±0.02ms     0.83  reshape.Explode.time_explode(1000, 5)

SOME BENCHMARKS HAVE CHANGED SIGNIFICANTLY.
PERFORMANCE INCREASED.
```

(which I don't think is related)
Maybe misreading your question but compilation warnings will now show as error messages, so CI will fail

* note that Cython warnings are separate from compilation warnings, so those wont fail CI

Sent from my iPad

> On Mar 19, 2020, at 2:13 PM, Jeff Reback <notifications@github.com> wrote:
> 
> ﻿
> @jreback approved this pull request.
> 
> lgtm. @jbrockmendel
> 
> how are the error messages if something is warning? intelligable?
> 
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub, or unsubscribe.

> Maybe misreading your question but compilation warnings will now show as error messages, so CI will fail * note that Cython warnings are separate from compilation warnings, so those wont fail CI
> […](#)
> Sent from my iPad
> On Mar 19, 2020, at 2:13 PM, Jeff Reback ***@***.***> wrote: ﻿ @jreback approved this pull request. lgtm. @jbrockmendel how are the error messages if something is warning? intelligable? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ok great.
thanks