Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Inbuilt macros/defines in gcc


On Thu, Oct 02, 2003 at 02:24:44PM +1000, Tiwari, Rajnish wrote:

> 	How can I quickly find out what internal #defines are
> 	set by gcc during compile ?

    [johnc@dropbear ~]$ touch tmp.c
    [johnc@dropbear ~]$ gcc -E -dM tmp.c
    #define __USER_LABEL_PREFIX__
    #define __SIZE_TYPE__ unsigned int
    #define __PTRDIFF_TYPE__ int
    #define __HAVE_BUILTIN_SETJMP__ 1
    #define __i386 1
    #define __GNUC_PATCHLEVEL__ 0
    #define __ELF__ 1
    #define __WCHAR_TYPE__ long int
    #define __NO_INLINE__ 1
    #define __GNUC_MINOR__ 96
    #define __WINT_TYPE__ unsigned int
    #define __tune_i386__ 1
    #define __unix 1
    #define unix 1
    #define __REGISTER_PREFIX__
    #define __linux 1
    #define __GNUC__ 2
    #define i386 1
    #define __linux__ 1
    #define __VERSION__ "2.96 20000731 (Red Hat Linux 7.3 2.96-113)"
    #define __i386__ 1
    #define linux 1
    #define __unix__ 1

If you give it a real source file, you'll get *all* the #defines from
that file and everything it includes.


Cheers,

John
-- 
whois !JC774-AU@xxxxxxxxxxxxxxx
GPG key id: 0xD59C360F
http://kirriwa.net/john/