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

Do not change glibc feature selection macros in unsupported ways #674

Merged
merged 1 commit into from
Feb 2, 2023
Merged

Do not change glibc feature selection macros in unsupported ways #674

merged 1 commit into from
Feb 2, 2023

Conversation

fweimer-rh
Copy link
Contributor

@fweimer-rh fweimer-rh commented Feb 2, 2023

The __USE_* macros are for glibc internal use only and must not be changed. The _*_SOURCE macros must be defined before the first glibc header file is included. If these rules are not followed, glibc header changes often introduce implicit function declarations or break the build in other ways.

The most straightforward solution is to define _GNU_SOURCE at the CMake level. The basename function is not used, and the sources already deal with the strerror_r API variant for _GNU_SOURCE. (An alternative approach could remove the strerror_r handling, and build with -D_XOPEN_SOURCE -D_DEFAULT_SOURCE, with a definition of _GNU_SOURCE at the start of src/tcp/tcp.c)


Related to:

The __USE_* macros are for glibc internal use only and must not
be changed.  The _*_SOURCE macros must be defined before the
first glibc header file is included.  If these rules are not
followed, glibc header changes often introduce implicit function
declarations or break the build in other ways.

The most straightforward solution is to define _GNU_SOURCE at the
CMake level.  The basename function is not used, and the sources
already deal with the strerror_r API variant for _GNU_SOURCE.
(An alternative approach could remove the strerror_r handling,
and build with -D_XOPEN_SOURCE -D_DEFAULT_SOURCE, with a definition
of _GNU_SOURCE at the start of src/tcp/tcp.c)
@sreimers sreimers merged commit 14ad287 into baresip:main Feb 2, 2023
@sreimers
Copy link
Member

sreimers commented Feb 2, 2023

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants