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

build: add -D_POSIX_C_SOURCE=200809L #55

Merged
merged 1 commit into from Jun 30, 2016
Merged

build: add -D_POSIX_C_SOURCE=200809L #55

merged 1 commit into from Jun 30, 2016

Conversation

gperciva
Copy link
Member

Without this, clang-3.8 with -std=c99 on Ubuntu 16.04 fails to find SSIZE_MAX
in limits.h. This is because SSIZE_MAX is in .../bits/posix1_lim.h, and
/usr/include/limits.h contains:

#ifdef  __USE_POSIX
/* POSIX adds things to <limits.h>.  */
# include <bits/posix1_lim.h>
#endif

and in "STRICT_ANSI" mode (implied by -std=c99, amongst other things),
__USE_POSIX is only defined if we've defined _POSIX_C_SOURCE or _XOPEN_SOURCE.

Without this, clang-3.8 with -std=c99 on Ubuntu 16.04 fails to find SSIZE_MAX
in limits.h.  This is because SSIZE_MAX is in .../bits/posix1_lim.h, and
/usr/include/limits.h contains:

    #ifdef  __USE_POSIX
    /* POSIX adds things to <limits.h>.  */
    # include <bits/posix1_lim.h>
    #endif

and in "__STRICT_ANSI__" mode (implied by -std=c99, amongst other things),
__USE_POSIX is only defined if we've defined _POSIX_C_SOURCE or _XOPEN_SOURCE.
@cperciva cperciva merged commit a7d57c0 into master Jun 30, 2016
@gperciva gperciva deleted the fix-compile branch June 30, 2016 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants