When not using configure, define _XOPEN_SOURCE#1246
When not using configure, define _XOPEN_SOURCE#1246daviesrob merged 1 commit intosamtools:developfrom
Conversation
|
[ |
Non-configure -std=c99 builds (as opposed to -std=gnu99 builds), e.g., `make CC='gcc -std=c99'`, previously failed as glibc (and maybe others) suppresses non-Standard-C functions in standard headers in this mode. This reactivates them. In particular: Rhtslib, Rsamtools, and other R-based builds do not use configure and don't supply their own config.h, and may specify -std=c99. (500 suffices for glibc, but macOS's headers require 600 to have them provide declarations for strdup() and snprintf(). This appears to be a bug related to their expected _C99_SOURCE define, which isn't defined.)
3423a9a to
1ef943c
Compare
Interesting. I see it failed on From what I can tell from searching, macos man pages for vsnprintf mentioned c99 but are silent regarding XOpen. |
|
Mojave's So setting 600 means it gets activated via I've spent a while looking through #423 and the rest of your old |
|
I can't recall why I chose 600, but I expect it was pragmatically what worked. |
|
According to the feature_test_macros man page, It certainly helps to be more resistant to random compiler options, thanks. |
|
That is an interesting point that 600 implies the C99 functions, and I think we've explained the pragmaticness of 600, and thanks for merging. Still… other things, notably |
Non-configure
-std=c99builds (as opposed to-std=gnu99builds), e.g.,make CC='gcc -std=c99', fail as glibc (and maybe others) suppresses non-Standard-C functions etc in standard headers in this mode:In particular: Rhtslib, Rsamtools, and other R-based builds do not use configure and don't supply their own config.h, and may specify
-std=c99. See for example rwdavies/STITCH#45, where HTSlib is built without running configure as part of an R build process — and that R build process supplies-std=c99.This is part of something I've been working on to tidy up the setting of these
_POSIX/_XOPEN…SOURCEdefines in configure.ac, but this is not the time to be proposing that! This part by itself will prevent some build failures for the R people and others though.