Question

In glibc 2.18 documentation, it says that if there are no macros defined and no standard mode given, then _POSIX_C_SOURCE defaults to 2.

When I test this on glic 2.17, I get a default value of 200809. Is this documentation out-of-date? Where can I find an updated version?

Was it helpful?

Solution

The documentation says

If you define this macro to a value greater than or equal to 2, then the functionality from the 1992 edition of the POSIX.2 standard (IEEE Standard 1003.2-1992) is made available.

If you define this macro to a value greater than or equal to 199309L, then the functionality from the 1993 edition of the POSIX.1b standard (IEEE Standard 1003.1b-1993) is made available.

and

If you ... don't define any of these macros explicitly, the effect is the same as defining _POSIX_C_SOURCE to 2 ...

A default value of 200809 for _POSIX_C_SOURCE does not contradict that. A value of 2 does not guarantee that "the functionality from the 1993 edition of the POSIX.1b standard (IEEE Standard 1003.1b-1993)" is unavailable, hence the default value does not have to guarantee it either.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top