Hello all,

does anyone remember what POSIX (or BSD)  version we require? We do
require it since we now rely on strdup being present which requires BSD
or POSIX conforming libc support.

This is tightly related to: https://trac.einsteintoolkit.org/ticket/1377

I just had yet another mysterious failure due to strdup() being
implicitly declared to return int rather than char* and failing once the
return value exceeded 2GB. As far as I can tell all of our option lists
should include either -D_BSD_SOURCE or -D_POSIX_C_SOURCE=200809L (yes,
200112L won't do even though strdup is in POSIX.1-2001) to get
prototypes for strdup.

Probably using _BSD is most portable (since OSX is a BSD and glibc on
Linux recongnizes it) even though (I believe) BSD is not really a
standard in the sense that C99 or POSIX is.

We should also have an autoconfig test for this. This fragment:

#include <string.h>
int strdup();
int main(void) {return 0;}

should *FAIL* to compile if strdup is properly declared but will compile
if it is not. So we'd need something that aborts in autoconf if a
compilation succeeds. As bonus (when using _BSD or using
_XOPEN_SOURCE_EXTENDED instead of _POSIX_C_SOURCE) this will also make
sure that M_PI is available.

Yours,
Roland

-- 
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://keys.gnupg.net.


-- 
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from http://keys.gnupg.net.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Users mailing list
[email protected]
http://cactuscode.org/mailman/listinfo/users

Reply via email to