Wolfgang Lux wrote:
>> Yes you NEED _XOPEN_SOURCE ... because it selects which, of different >> variant of some functions, you actually get to use. >> So without it the code may compile but not run correctly. >> >> The example that springs to mind is strerror_r() ... if you don't have it >> defined then any system error messages in NSError or in logs will contain >> garbage. > > Sorry for being dumb (and for not reading the comment in common.h, which said > exactly that). But if this only affects the strerror_r function, wouldn't it > be simpler to have two versions of the code in the _systemError: method (one > for the GNU version and one for the POSIX version) instead of this nasty > fiddling with preprocessor macros that seems hard to get right for everyone? And even worse, it doesn't seem to be necessary on newer Linux systems too, given this comment from the strerror_r man page: If no feature test macros are explicitly defined, then (since glibc 2.4) _POSIX_SOURCE is defined by default with the value 200112L, so that the XSI-compliant version of strerror_r() is provided by default. Wolfgang _______________________________________________ Gnustep-dev mailing list Gnustep-dev@gnu.org https://lists.gnu.org/mailman/listinfo/gnustep-dev