-
Notifications
You must be signed in to change notification settings - Fork 327
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
_GNU_SOURCE not defined on Debian/Ubuntu (was: c99 does not define getaddrinfo()) #2
Comments
|
Here is the line used:
I have no And yes, it works fine with Maybe you can grab default search path from gcc with |
Get rid of the fragile glibc auto-detection mechanism and define _GNU_SOURCE unconditionally in order to fix the build on recent GNU libc systems such as Debian and Ubuntu. On non-GNU libc implementations, _GNU_SOURCE should not have any effect. Issue: #2 Reported by: Vincent Bernat
Fixed in latest master. Thank you for reporting the issue. |
Hi!
When compiling on Debian, I get the following error:
The problem is that
getaddrinfo()
is a POSIX.1g extension and is not available in pure C99. It may work if libevent has also been compiled with--std=c99
becausestruct evutil_addrinfo
will be defined as a full structure. Otherwise, it is just an alias tostruct addrinfo
which is not defined innetdb.h
but still exists as an incomplete type inevent2/utils.h
.You can either compile with
--std=gnu99
or with-D_POSIX_C_SOURCE=200112L
. With the later option, there are additional errors later. Moreover, compiling with--std=gnu99
almost silents out any warnings. I don't know if such a standard is portable outside of gcc.The text was updated successfully, but these errors were encountered: