Brian Inglis wrote in <f5634d94-4b76-5852-316d-a634d7191ae8@SystematicSw\ .ab.ca>: |On 2019-11-23 03:20, Robert Elz wrote: |> Date: Sat, 23 Nov 2019 02:52:43 -0500 |> From: Andras Farkas <deepbluemistake@gmail.com> |> Message-ID: <CAA0nTRsAVKLycy=kxt3BMHDv9zmSUEZTMdAbRfO3P+V22aS3vA@mai\ |> l.gmail.com> |> |>| (because it IS the implementation, yet it's also not the OS) |> |> That distinction, which is made by many standards in various fields |> is totally worthless - whether any particular piece of code (or |> hardware or whatever) is implementation or application (or however |> the relevant standard attempts to divide the world into two groups) |> depends entirely upon where you are looking at it from. | |Programmers must clearly distinguish between standard or documented system |independent feature test macros intended to be set by the programmer in |feature_test_macros(7) and the documentation for the system headers, \ |library |interfaces, and standards e.g | #define _POSIX_C_SOURCE 200809L | #define _XOPEN_SOURCE 700 | #define _DEFAULT_SOURCE 1 | #define _GNU_SOURCE 1 |Those feature test macros enable certain features of implementations in |conformance with standards or documentation. Since you refer to feature_test_macros(7) i want to add that i find headers of especially elder systems notoriously buggy regarding the above. One should especially not trust statements like "defining x produces the same effects as defining y". I am in the lucky position to be able to test on several operating systems, and thanks to OpenCSW.org this also includes SunOS 5.9 - 5.11. My findings are that you are best served with a sledgehammer by defining all of the above (i do except _DEFAULT_SOURCE), and i also still have a _DARWIN_C_SOURCE lingering even though the last i tested was Mountain Lion. (But it still works like this out of the box as of today via Homebrew and MacPorts.) |Those standard or documented system independent feature test macros \ |should be |distinguished from implementation specific feature macros often set in |/usr/include/features.h, /usr/include/sys/features.h, and their inclusions, |included from feature test dependent library headers, which may set \ |feature test |macros, and implementation specific feature macros. |Those implementation specific feature macros are tested in library \ |headers in |lieu of various feature test macros e.g. Linux __USE_POSIX, __USE_XOPEN, \ |and |should never be used or set by the programmer as they vary between |implementations and may be changed by any implementation release, as \ |they are |non-standard and undocumented. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)