Skip to content

Initialize variables in pqyear, pquarter #34409

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

Conversation

TomAugspurger
Copy link
Contributor

This resolves the -Wmaybe-uninitialized warning observed when building with the manylinux1 docker image

gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DNPY_NO_DEPRECATED_API=0 -Ipandas/_libs/tslibs -I./pandas/_libs/tslibs -I/opt/python/cp38-cp38/lib/python3.8/site-packages/numpy/core/include -I/opt/python/cp38-cp38/include/python3.8 -c pandas/_libs/tslibs/period.c -o build/temp.linux-x86_64-3.8/pandas/_libs/tslibs/period.o
pandas/_libs/tslibs/period.c: In function ‘__pyx_f_6pandas_5_libs_6tslibs_6period_pqyear’:
pandas/_libs/tslibs/period.c:12464:3: warning: ‘__pyx_v_year’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   return __pyx_r;
   ^
pandas/_libs/tslibs/period.c: In function ‘__pyx_f_6pandas_5_libs_6tslibs_6period_pquarter’:
pandas/_libs/tslibs/period.c:12512:3: warning: ‘__pyx_v_quarter’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   return __pyx_r;

Hopefully this doesn't break anything. IIUC, these pointers are just used to set the result, so it shouldn't matter what the value is going in?

Closes #34114

@TomAugspurger
Copy link
Contributor Author

cc @WillAyd and @jbrockmendel for checking the C code.

@TomAugspurger TomAugspurger added the Build Library building on various platforms label May 27, 2020
@TomAugspurger TomAugspurger added this to the 1.1 milestone May 27, 2020
@TomAugspurger
Copy link
Contributor Author

Not necessary to backport, since this only affects the builds after -Werror was added (1.1)

@WillAyd
Copy link
Member

WillAyd commented May 27, 2020

Hmm strange that this is required but also pretty harmless. A zero versus a junk value getting returned is probably moot :-)

lgtm

@TomAugspurger
Copy link
Contributor Author

Thanks for confirming.

@TomAugspurger TomAugspurger merged commit 7e1fab9 into pandas-dev:master May 27, 2020
@TomAugspurger TomAugspurger deleted the macpython-build-fixup branch May 27, 2020 16:30
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MacPython linux build failing
2 participants