From owner-freebsd-current Sun Sep 8 20:50:29 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 07E9B37B400; Sun, 8 Sep 2002 20:50:24 -0700 (PDT) Received: from khavrinen.lcs.mit.edu (khavrinen.lcs.mit.edu [18.24.4.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id 73DFB43E3B; Sun, 8 Sep 2002 20:50:23 -0700 (PDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: from khavrinen.lcs.mit.edu (localhost [IPv6:::1]) by khavrinen.lcs.mit.edu (8.12.3/8.12.5) with ESMTP id g893oHVo062195 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=OK); Sun, 8 Sep 2002 23:50:17 -0400 (EDT) (envelope-from wollman@khavrinen.lcs.mit.edu) Received: (from wollman@localhost) by khavrinen.lcs.mit.edu (8.12.3/8.12.5/Submit) id g893oHMs062192; Sun, 8 Sep 2002 23:50:17 -0400 (EDT) (envelope-from wollman) Date: Sun, 8 Sep 2002 23:50:17 -0400 (EDT) From: Garrett Wollman Message-Id: <200209090350.g893oHMs062192@khavrinen.lcs.mit.edu> To: current@FreeBSD.org Cc: kan@FreeBSD.org Subject: No way to tell when `long long' is or is not supported? 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 GCC used to define a macro __STRICT_ANSI__ when `-ansi' was given on the command line. The current version does not do this, which breaks detection of whether `long long' is allowed. (For some reason this is not hit in -current builds, but I have made some fixes to which trigger it in every program which sets WARNS.) Rather than trying to deduce whether `long long' is supported from other macros, I simply modified the compiler driver to tell us. (BTW, the `-posix' flag is utterly useless and should go.) If anyone has a better way to accomplish this, I'm all ears. (I suspect that the removal of __STRICT_ANSI__ was intentional, since it's not clear what that should mean in the face of multiple C language standards. The trouble is that C89 (implied by `-ansi') is otherwise indistinguishable from C89+GCC-extensions (implied by the absence of `-ansi'), and we need to make both cases work properly.) -GAWollman Index: freebsd-spec.h =================================================================== RCS file: /home/ncvs/src/contrib/gcc/config/freebsd-spec.h,v retrieving revision 1.2 diff -u -r1.2 freebsd-spec.h --- freebsd-spec.h 10 May 2002 19:05:07 -0000 1.2 +++ freebsd-spec.h 8 Sep 2002 18:34:29 -0000 @@ -85,12 +85,13 @@ the final CPP_PREDEFINES value. */ #define FBSD_CPP_PREDEFINES \ - "-D__FreeBSD__=5 -D__FreeBSD_cc_version=500003 -Dunix -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" + "-D__FreeBSD__=5 -D__FreeBSD_cc_version=500004 -Dunix -D__KPRINTF_ATTRIBUTE__ -Asystem=unix -Asystem=bsd -Asystem=FreeBSD" #endif /* ! FREEBSD_NATIVE */ /* Provide a CPP_SPEC appropriate for FreeBSD. We just deal with the GCC - option `-posix', and PIC issues. */ + option `-posix', and PIC issues. Also deal with the problem of + detecting support for the `long long' type. */ #define FBSD_CPP_SPEC " \ %(cpp_cpu) \ @@ -98,6 +99,8 @@ %{munderscores: -D__UNDERSCORES__} \ %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \ %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \ + %{!ansi:%{!std=*:-D__LONG_LONG_SUPPORTED}%{std=gnu*:-D__LONG_LONG_SUPPORTED}}\ + %{std=c99:-D__LONG_LONG_SUPPORTED}\ %{posix:-D_POSIX_SOURCE}" /* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message