From owner-freebsd-current Thu Nov 8 14:20: 7 2001 Delivered-To: freebsd-current@freebsd.org Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by hub.freebsd.org (Postfix) with ESMTP id 7A88437B405; Thu, 8 Nov 2001 14:19:58 -0800 (PST) Received: (from uucp@localhost) by sax.sax.de (8.9.3/8.9.3) with UUCP id XAA03055; Thu, 8 Nov 2001 23:19:39 +0100 (CET) Received: (from j@localhost) by uriah.heep.sax.de (8.11.6/8.11.6) id fA8LxF275508; Thu, 8 Nov 2001 22:59:15 +0100 (MET) (envelope-from j) Date: Thu, 8 Nov 2001 22:59:15 +0100 From: Joerg Wunsch To: Cyrille Lefevre Cc: Warner Losh , schweikh@freebsd.org, freebsd-current@freebsd.org Subject: Re: malloc.h Message-ID: <20011108225915.A75044@uriah.heep.sax.de> Reply-To: Joerg Wunsch References: <200111080839.fA88dv740802@harmony.village.org> <200111080950.fA89oIk21059@gits.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <200111080950.fA89oIk21059@gits.dyndns.org>; from clefevre@citeweb.net on Thu, Nov 08, 2001 at 10:50:18AM +0100 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG As Cyrille Lefevre wrote: > the difference is that if __STDC__ isn't defined, #if (-0)==0 > continue to work. Well, not really. :-) Just for grins, i dug out my old CP/M C compiler. (SuperSoft C, 1983 vintage) That one's the only one so far i've seen where #if __STDC__ wouldn't work as expected -- but #if (__STDC__ - 1) == 0 wouldn't either. Apparently, this compiler substituted a `1' for any undefined identifier. However #ifdef __STDC__ works there as well. Since this seems to be consensus for many other header files (Sun and HP, too), and is completely standards-compliant (the standard mandates that this macro is predefined to 1 on a conformant implementation and undefined otherwise -- Jens, is this OK?), i'd vote for using that one. > IMHO, the correct statement is : > [obfuscated cpp code contest candidate :-) removed] > also, as I remember me, Solaris or HP uses the construction I post > in they headers. Well, no. Solaris uses #if (__STDC__-1==0) only in connection with other conditions in the same #if part. Otherwise, they use a simple #ifdef __STDC__ as well. Anyway, i don't care much except that i'd like to see gcc -traditional accept since it used to be a legitimate header at its time. Otherwise, we should ban the entire -traditional option as well (it makes string literals writeable, and a few other things). -- cheers, J"org .-.-. --... ...-- -.. . DL8DTL http://www.sax.de/~joerg/ NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message