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

bpo-41100: bugfix, arm64 Mac OS, missing #include <AvailabilityMacros.h> #21588

Conversation

lawrence-danna-apple
Copy link
Contributor

@lawrence-danna-apple lawrence-danna-apple commented Jul 21, 2020

MAC_OS_X_VERSION_MAX_ALLOWED is defined in this header. Because it is
not included nsexeclength is defined as the wrong type, causing an
incompatible pointer to be passed to _NSGetExecutablePath on arm64

https://bugs.python.org/issue41100

MAC_OS_X_VERSION_MAX_ALLOWED is defined in this header.   Because it is
not included nsexeclength is defined as the wrong type, causing an
incompatible pointer to be passed to _NSGetExecutablePath
Copy link
Contributor

@BoboTiG BoboTiG left a comment

Choose a reason for hiding this comment

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

Thanks, that easy fix would solve that GCC warning:

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal  -I. -I./Include    -DPy_BUILD_CORE_BUILTIN  -c ./Modules/_operator.c -o Modules/_operator.o
./Modules/getpath.c:942:40: warning: incompatible pointer types passing 'unsigned long *' to parameter of type 'uint32_t *' (aka 'unsigned int *') [-Wincompatible-pointer-types]
    if (_NSGetExecutablePath(execpath, &nsexeclength) != 0
                                       ^~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/mach-o/dyld.h:98:54: note: passing argument to parameter 'bufsize' here
extern int _NSGetExecutablePath(char* buf, uint32_t* bufsize)                 __OSX_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0);
                                                     ^

@@ -0,0 +1 @@
fix a bug in getpath.c for arm64 Mac OS
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rework that sentence as this is not only for ARM64 but x86_64 too:

Suggested change
fix a bug in getpath.c for arm64 Mac OS
Fixed a bug in `Modules/getpath.c` for macOS 11. Patch by Lawrence D'Anna.

@ned-deily
Copy link
Member

Thanks for the PR. It has been superseded by changes in PR 22855 which remove the need for AvailabilityMacros.h in getpath.c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants