[LCP]list all defines

Angus Mackay amackay at gusnet.cx
Thu Jul 12 19:02:05 UTC 2001


yes:
  (amackay at weasel)~$ gcc -x c -E -dM /dev/null 
  #define __linux__ 1 
  #define linux 1 
  #define __i386__ 1 
  #define __i386 1 
  #define __i686 1 
  #define __GNUC_MINOR__ 95 
  #define pentiumpro 1 
  #define __pentiumpro 1 
  #define i386 1 
  #define i686 1 
  #define __pentiumpro__ 1 
  #define __unix 1 
  #define __unix__ 1 
  #define __i686__ 1 
  #define __GNUC__ 2 
  #define __linux 1 
  #define __ELF__ 1 
  #define unix 1 
  (amackay at weasel)~$ 

-x c       ------> the language is C (not c++ or objective C)
-E         ------> run the pre-processor only, don't compile
-dM        ------> dump macros
/dev/null  ------> the input file, nothin'

> Is there a way to get the compiler/preprocessor to list all the defines that
> have been declared?



More information about the linuxCprogramming mailing list