Date: 02 Jun 2001 03:48:27 +0200 From: Cyrille Lefevre <clefevre-lists@noos.fr> To: Farooq Mela <fmela0@sm.socccd.cc.ca.us> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: _ANSI_SOURCE vs. _ANSI_C_SOURCE Message-ID: <g0dj649g.fsf@gits.dyndns.org> In-Reply-To: <3B170531.47E6724F@sm.socccd.cc.ca.us> References: <3B170531.47E6724F@sm.socccd.cc.ca.us>
next in thread | previous in thread | raw e-mail | index | archive | help
Farooq Mela <fmela0@sm.socccd.cc.ca.us> writes: > I am wondering why some operating systems use the macro _ANSI_SOURCE > while others (ie Linux) use _ANSI_C_SOURCE to indicate that the source > compiled is ANSI-compliant (and similarly with _POSIX_SOURCE and > _POSIX_C_SOURCE). I have neither copies of the ANSI nor POSIX spec, here is explained the difference between _POSIX_SOURCE and _POSIX_C_SOURCE : http://www.freebsd.org/cgi/man.cgi?query=standards&apropos=0&sektion=0&manpath=SunOS+5.8&format=html in short : _POSIX_C_SOURCE is an extention of _POSIX_SOURCE. the later only refer to the original standard and the former to subsequent standards. more informations may be found in stdsyms(5) on http://docs.hp.com but none of them refer to any _ANSI_SOURCE or whatever. as far as I know, the only symbol defined by the ANSI standard is __STDC__ which should be tested like this to be safe : #if (__STDC__ - 0) != 0 ansi compiler #else k&r compiler #endif > and I don't see any mention of either of these in APUE. So I'm > guessing these are sort of de-facto macros that are being used. Can > somebody shed some light on why these are different, and why some have > the _C in the middle? Cyrille. -- home: mailto:clefevre@redirect.to UNIX is user-friendly; it's just particular work: mailto:Cyrille.Lefevre@edf.fr about who it chooses to be friends with. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?g0dj649g.fsf>