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
Building without _DEFAULT_SOURCE or _XOPEN_SOURCE >= 500 and without -Werror=implicit-function-declaration ends up in a segfault #33
Comments
Hello @Danger89 👋 The warning happening at line As per Please make sure you define e.g. |
Hi oke let me test that. But I think this won't solve the second warning, which most likely is the root cause of the segfault: Yes, I'm under Linux. I use your library for my project that runs under Linux as well as een cross build towards Windows (mingw). |
There won't be a warning at all if you use Without
or
And this is what causes the warning and the segfault. You should really compile with |
Thanks for your advice. I added those -Werror flags to the Anyway, for the CMake users out there, this is how you add the definition using cmake to a specific target: target_compile_definitions(${TARGET_NAME} PUBLIC _XOPEN_SOURCE=500) EDIT: This did fixed my problem btw! 🥳 |
Maybe you want to update the README.md with a small note regarding the |
I'll think about how to document these requirements for all platforms supported |
Can you please try the |
Maybe remove your "invalid" label to this issue. Computer says no:
(Native Linux build) @gpakosz EDIT: Changing your code to the following, solves the issue above #undef _DEFAULT_SOURCE
#define _DEFAULT_SOURCE |
The I force pushed the I'll merge soon if it works for you. |
Thanks. READY WHEN YOU ARE. |
LGTM. You can merge 👍🏽 |
it works 🚀 |
When using the following C standard setting in CMake, the build give warnings. But worse my executable will now segfault:
Build output:
Run-time crash / segfault at line 201 in whereami.c:
The text was updated successfully, but these errors were encountered: