From owner-freebsd-current Sat Nov 10 6:21:13 2001 Delivered-To: freebsd-current@freebsd.org Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by hub.freebsd.org (Postfix) with ESMTP id 8183E37B427; Sat, 10 Nov 2001 06:21:10 -0800 (PST) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 2FB9A17D14; Sat, 10 Nov 2001 15:21:08 +0100 (CET) Received: (from uucp@localhost) by bremen.shuttle.de (8.9.3/8.9.3/LOCALMTA) with UUCP id PAA32322; Sat, 10 Nov 2001 15:21:08 +0100 Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.11.3/8.11.1) id fAADqNE01729; Sat, 10 Nov 2001 14:52:23 +0100 (CET) (envelope-from schweikh) Date: Sat, 10 Nov 2001 14:52:22 +0100 From: Jens Schweikhardt To: Joerg Wunsch Cc: Cyrille Lefevre , Warner Losh , schweikh@freebsd.org, freebsd-current@freebsd.org Subject: Re: malloc.h Message-ID: <20011110145222.A942@schweikhardt.net> References: <200111080839.fA88dv740802@harmony.village.org> <200111080950.fA89oIk21059@gits.dyndns.org> <20011108225915.A75044@uriah.heep.sax.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5i In-Reply-To: <20011108225915.A75044@uriah.heep.sax.de>; from j@uriah.heep.sax.de on Thu, Nov 08, 2001 at 10:59:15PM +0100 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 Hello Jörg et al, # 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. This contradicts the then unknown C89 Standard, which requires all remaining identifiers to be replaced with the pp-number 0. Here we have an example of why standardization can be a Good Thing :-) # #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 This is correct. # and undefined otherwise -- Jens, is this # OK?), The "undefined otherwise" is merely wishful thinking, because the Standard can't say anything about implementations that don't claim conformance. So in theory there is nothing you can do if an uncompliant implementations defines __STDC__ to any sequence of pp-tokens. C99 6.10.8 says: __STDC__ The integer constant 1, intended to indicate a conforming implementation. # i'd vote for using that one. As I understand it, the only problem is if some implementation indicates non-conformance with #define __STDC__ 0, which is unheard of to me, and, if I were an implementor of such a system, I'd just leave it undefined. Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message