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

Add missing feature macros #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Hugal31
Copy link

@Hugal31 Hugal31 commented Jun 9, 2021

We were using some functions (like strdup) without defining the required feature
macros. For instance, strdup requires _POSIX_C_SOURCE >= 200809L, and
vasprintf _GNU_SOURCE. This was causing some SEGFAULT because the functions were
assumed to have the signature int f(), but returned something of a different size (as strdup).

Fix this by defining _DEFAULT_SOURCE (which defines _POSIX_C_SOURCE >= 200809L) and _GNU_SOURCE.

Note: this should not impact the system that doesn't have the impacted functions for the functions we check with CHECK_FUNCTION_EXISTS.

We were using some functions (like strdup) without defining the required feature
macros. For instance, strdup requires `_POSIX_C_SOURCE >= 200809L`, and
vasprintf _GNU_SOURCE. This was causing some SEGFAULT because the functions were
assumed to have the signature `int f()`.

Fix this by defining `_DEFAULT_SOURCE` (which defines `_POSIX_C_SOURCE >=
200809L`) and _GNU_SOURCE.
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.

1 participant