From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1529 invoked by alias); 7 May 2003 07:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 1458 invoked by uid 71); 7 May 2003 07:26:01 -0000 Date: Wed, 07 May 2003 07:26:00 -0000 Message-ID: <20030507072601.1457.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Andris Pavenis Subject: Re: other/10659: docs need list of '#define' values generated by compiler Reply-To: Andris Pavenis X-SW-Source: 2003-05/txt/msg00446.txt.bz2 List-Id: The following reply was made to PR other/10659; it has been noted by GNATS. From: Andris Pavenis To: bobf@mrp3.com, gcc-gnats@gcc.gnu.org Cc: Subject: Re: other/10659: docs need list of '#define' values generated by compiler Date: Wed, 7 May 2003 10:27:23 +0300 On Wednesday 07 May 2003 09:29, bobf@mrp3.com wrote: > >Number: 10659 > >Category: other > >Synopsis: docs need list of '#define' values generated by compiler > >Confidential: no > >Severity: non-critical > >Priority: medium > >Responsible: unassigned > >State: open > >Class: doc-bug > >Submitter-Id: net > >Arrival-Date: Wed May 07 06:36:00 UTC 2003 > >Closed-Date: > >Last-Modified: > >Originator: bob frazier > >Release: gcc 3.2.2 manual (on line) > >Organization: > >Environment: > > N/A (on-line documentation) > > >Description: > > I was unable to locate a page that described which pre-defined symbols were > generated by the compiler. In some cases symbols (such as __STDC__ ) were > mentioned in passing, but in no way could I find symbols to indicate what > the CPU options were, optimization level of the compiler, or even simple > ones like '__LINE__' (which you assume should be there) or '__cplusplus' > (if the C++ compiler is being invoked, for 'dual use' headers). I am not > even sure if I can rely on the use of '__cplusplus' either which is one of > the things I was looking for. The other was the CPU type so that for SOME > cpu's I'd have one kind of in-line assembler, and for other cpu's I'd have > another kind, and for the rest I'd use C language (as an example). > > So, someplace in the documentation, please list all of the '#define' > constants that the compiler generates, and the options that control them. > Having them all on a single page would be nice... > > >How-To-Repeat: > > reference: http://gcc.gnu.org/onlinedocs/gcc-3.2.2/gcc/ > > >Fix: > > recommend adding page with '#define's generated by the compiler (based on > compiler options or the actual language compilers being run). There is easy way how to get them (example for C on machine where I'm writing these lines, for C++ use '-x c++' instead of '-x c'). Andris andris@geomets2:~$ gcc -E -dD -x c /dev/null | grep ^#de #define __VERSION__ "3.2.2" #define __USER_LABEL_PREFIX__ #define __REGISTER_PREFIX__ #define __HAVE_BUILTIN_SETJMP__ 1 #define __SIZE_TYPE__ unsigned int #define __PTRDIFF_TYPE__ int #define __WCHAR_TYPE__ long int #define __WINT_TYPE__ unsigned int #define __STDC__ 1 #define __GNUC__ 3 #define __GNUC_MINOR__ 2 #define __GNUC_PATCHLEVEL__ 2 #define __GXX_ABI_VERSION 102 #define __ELF__ 1 #define unix 1 #define __gnu_linux__ 1 #define linux 1 #define __ELF__ 1 #define __unix__ 1 #define __gnu_linux__ 1 #define __linux__ 1 #define __unix 1 #define __linux 1 #define __NO_INLINE__ 1 #define __STDC_HOSTED__ 1 #define i386 1 #define __i386 1 #define __i386__ 1 #define __tune_i386__ 1