Re: System/ Compiler specific macros
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Tue, 05 Jul 2005 17:10:34 GMT
Robert Gamble wrote:
> vsnadagouda@xxxxxxxxx wrote:
>>
>> For one of my applications I need to know what are all the
>> predefined system/ compiler specific macros are. All these days
>> I used to use "-v" or "-#" as a compiler option to figure out
>> the required information. But recently GCC 3.4.* compilers have
>> stopped throwing out this piece of information.
>>
>> Is there any way I can write a piece of C program (or may be
>> any way) and figure out all the system and compiler specific
>> macros?
>
> This cannot portably be done, why do you think you need to do this?
>
> As far as gcc goes, from the documentation:
>
> "Assuming you have no file foo.h, the command
> touch foo.h; cpp -dM foo.h
> will show all the predefined macros."
The options used will affect that result. For ex. on my system:
[1] c:\c\junk>cpp -dM -W -Wall -ansi -pedantic empty.c
#define __HAVE_BUILTIN_SETJMP__ 1
#define __unix__ 1
#define __i386__ 1
#define __SIZE_TYPE__ long unsigned int
#define __DJGPP 2
#define __USER_LABEL_PREFIX__ _
#define __tune_pentium__ 1
#define __STDC_HOSTED__ 1
#define __MSDOS__ 1
#define DJGPP 2
#define __WCHAR_TYPE__ short unsigned int
#define __DJGPP__ 2
#define __WINT_TYPE__ int
#define __tune_i586__ 1
#define __DJGPP_MINOR__ 3
#define __STRICT_ANSI__ 1
#define __GO32__ 1
#define DJGPP_MINOR 3
#define __STDC__ 1
#define __PTRDIFF_TYPE__ int
#define __DJGPP_MINOR 3
#define __REGISTER_PREFIX__
#define __NO_INLINE__ 1
#define __i386 1
#define __VERSION__ "3.2.1"
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
.
- References:
- System/ Compiler specific macros
- From: vsnadagouda
- Re: System/ Compiler specific macros
- From: Robert Gamble
- System/ Compiler specific macros
- Prev by Date: Re: Code Effect
- Next by Date: Re: If forget to fclose() after fopen(), is there any testing tool who can detect it automatically?
- Previous by thread: Re: System/ Compiler specific macros
- Next by thread: Re: System/ Compiler specific macros
- Index(es):
Relevant Pages
|
Loading