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

-Wstrict-prototypes warnings on macOS #103167

Closed
sobolevn opened this issue Apr 1, 2023 · 1 comment
Closed

-Wstrict-prototypes warnings on macOS #103167

sobolevn opened this issue Apr 1, 2023 · 1 comment
Assignees
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@sobolevn
Copy link
Member

sobolevn commented Apr 1, 2023

Recently, I've started noticing new issues while compiling CPython on my mac.

Something like:

Python/ceval_gil.c:470:40: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
unsigned long _PyEval_GetSwitchInterval()
                                       ^
                                        void
1 warning generated.

Details aboit -Wstrict-prototypes: https://www.cism.ucl.ac.be/Services/Formations/ICS/ics_2013.0.028/composer_xe_2013/Documentation/en_US/compiler_c/main_cls/GUID-22FD192C-4C9D-4C16-B3DE-C3629D2EE483.htm

Seems like clang now requires (void) for functions without arguments.

Other developers have also seen these. I have a PR with the fix ready.

To find functions without arguments I've used this regex: \(\)\n+\{
It showed:

» ag '\(\)\n+\{' */**/*.c      
Modules/_tkinter.c
124:_get_tcl_lib_path()
125:{

Modules/posixmodule.c
8549:win32_getppid()
8550:{
13333:check_ShellExecute()
13334:{

PC/launcher.c
452:locate_store_pythons()
453:{
469:locate_venv_python()
470:{
498:locate_all_pythons()
499:{
697:locate_wrapped_script()
698:{
1037:static void read_commands()
1038:{
1687:get_process_name()
1688:{

PC/launcher2.c
135:_getNativeMachine()
136:{
166:isAMD64Host()
167:{
173:isARM64Host()
174:{

Python/ceval_gil.c
470:unsigned long _PyEval_GetSwitchInterval()
471:{

Python/initconfig.c
2358:config_envvars_usage()
2359:{
2364:config_xoptions_usage()
2365:{

Python/sysmodule.c
1491:_sys_getwindowsversion_from_kernel32()
1492:{

Linked PRs

@sobolevn sobolevn added the type-bug An unexpected behavior, bug, or error label Apr 1, 2023
@sobolevn sobolevn self-assigned this Apr 1, 2023
@sobolevn sobolevn added the build The build process and cross-build label Apr 1, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Apr 1, 2023
@sunmy2019
Copy link
Member

LGTM

encukou pushed a commit that referenced this issue Apr 5, 2023
@encukou encukou closed this as completed Apr 5, 2023
gaogaotiantian pushed a commit to gaogaotiantian/cpython that referenced this issue Apr 8, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants