From owner-freebsd-current Mon Sep 9 3: 6:50 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6FCA137B400; Mon, 9 Sep 2002 03:06:46 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0524C43E3B; Mon, 9 Sep 2002 03:06:45 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id UAA09758; Mon, 9 Sep 2002 20:06:39 +1000 Date: Mon, 9 Sep 2002 20:14:08 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: "David O'Brien" Cc: Garrett Wollman , , Subject: Re: No way to tell when `long long' is or is not supported? In-Reply-To: <20020909070700.GA26978@dragon.nuxi.com> Message-ID: <20020909195812.E6306-100000@gamplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Mon, 9 Sep 2002, David O'Brien wrote: > On Sun, Sep 08, 2002 at 11:50:17PM -0400, Garrett Wollman wrote: > > GCC used to define a macro __STRICT_ANSI__ when `-ansi' was given on > > the command line. The current version does not do this, > > It seems to work for me: For me too. I vaguely remember that it didn't work for all cases, but I can't find any broken case now (perhaps gcc-3.2 unbroke it). > The problem is it is also set for this: > > $ /usr/bin/cc -std=c99 foo.c > foo.c:2:2: #error __STRICT_ANSI__ > > As you mentioned, this is now not a good test to decide if 'long long' is > supported. The __STDC_VERSION__ test in the XXX comment before the __STRICT_ANSI__ ifdef works for -std=c99. A messy ifdef to handle old compilers seems to be unavoidable until we drop support for nonstandard (non-C90) features in old compilers. BTW, I'm still waiting for the bogus LONGLONG lint markup to be removed from stdlib.h. lint should warn about "long long" if and only if "ong long" is a syntax error for the compiler that lint is checking for. Lint must see the same value for __LONG_LONG_SUPPORTED as the relevant compiler would, and then the LONGLONG markup is a no-op. The markup mainly breaks detection of broken lints and/or broken setting of __LONG_LONG_SUPPORTED. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message