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

grp module attempts to build even if getgrent family of functions are unavailable #114875

Closed
mhsmith opened this issue Feb 1, 2024 · 0 comments · Fixed by #114876
Closed

grp module attempts to build even if getgrent family of functions are unavailable #114875

mhsmith opened this issue Feb 1, 2024 · 0 comments · Fixed by #114876
Labels
build The build process and cross-build type-bug An unexpected behavior, bug, or error

Comments

@mhsmith
Copy link
Member

mhsmith commented Feb 1, 2024

Bug report

Bug description:

In the configure script, the only prerequisite for the grp module is currently the getgrgid function. Older versions of Android have this function, but they don't have the getgrent function, which the grp module uses unconditionally. This causes the build to fail as follows:

/Users/msmith/Library/Android/sdk/ndk/22.1.7171670/toolchains/llvm/prebuilt/darwin-x86_64/bin/x86_64-linux-android21-clang  -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall    -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include     -c ./Modules/grpmodule.c -o Modules/grpmodule.o
./Modules/grpmodule.c:127:24: warning: unused variable 'buf2' [-Wunused-variable]
    char *buf = NULL, *buf2 = NULL;
                       ^
./Modules/grpmodule.c:205:24: warning: unused variable 'buf2' [-Wunused-variable]
    char *buf = NULL, *buf2 = NULL, *name_chars;
                       ^
./Modules/grpmodule.c:287:5: error: implicit declaration of function 'setgrent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    setgrent();
    ^
./Modules/grpmodule.c:288:17: error: implicit declaration of function 'getgrent' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    while ((p = getgrent()) != NULL) {
                ^

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

Linked PRs

@mhsmith mhsmith added the type-bug An unexpected behavior, bug, or error label Feb 1, 2024
@Eclips4 Eclips4 added the build The build process and cross-build label Feb 1, 2024
erlend-aasland added a commit that referenced this issue Feb 2, 2024
…14876)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
…le (python#114876)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
fsc-eriker pushed a commit to fsc-eriker/cpython that referenced this issue Feb 14, 2024
…le (python#114876)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
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

Successfully merging a pull request may close this issue.

2 participants