From owner-freebsd-hackers Fri Jun 1 18:48:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.noos.fr (lafontaine.noos.net [212.198.2.72]) by hub.freebsd.org (Postfix) with ESMTP id 4B6B737B423 for ; Fri, 1 Jun 2001 18:48:31 -0700 (PDT) (envelope-from clefevre@redirect.to) Received: (qmail 1044951 invoked by uid 0); 2 Jun 2001 01:48:29 -0000 Received: from d081.dhcp212-198-228.noos.fr (HELO gits.dyndns.org) ([212.198.228.81]) (envelope-sender ) by lafontaine.noos.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 2 Jun 2001 01:48:29 -0000 Received: (from root@localhost) by gits.dyndns.org (8.11.3/8.11.3) id f521mSe99429; Sat, 2 Jun 2001 03:48:28 +0200 (CEST) (envelope-from clefevre@redirect.to) To: Farooq Mela Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: _ANSI_SOURCE vs. _ANSI_C_SOURCE References: <3B170531.47E6724F@sm.socccd.cc.ca.us> X-Face: V|+c;4!|B?E%BE^{E6);aI.[<97Zd*>^#%Y5Cxv;%Y[PT-LW3;A:fRrJ8+^k"e7@+30g0YD0*^^3jgyShN7o?a]C la*Zv'5NA,=963bM%J^o]C Reply-To: Cyrille Lefevre In-Reply-To: <3B170531.47E6724F@sm.socccd.cc.ca.us> Mail-Copies-To: never From: Cyrille Lefevre Date: 02 Jun 2001 03:48:27 +0200 Message-ID: Lines: 37 User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Farooq Mela 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