[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Predefined symbols in gcc



Perhaps everyone else already knows this, but I just found out today.

There is an easy way to get gcc to print a list of predefined symbols:
	-E -pM

For example, with the egcs-1.0.2-prerelease:
	
> m68k-rtems-gcc -ansi -mcpu32  -E -dM p.c | sort
#define __GNUC_MINOR__ 90
#define __GNUC__ 2
#define __STRICT_ANSI__ 1
#define __mc68000 1
#define __mc68000__ 1
#define __mcpu32 1
#define __mcpu32__ 1
#define __rtems 1
#define __rtems__ 1


> m68k-rtems-gcc -ansi -E -dM p.c | sort
#define __GNUC_MINOR__ 90
#define __GNUC__ 2
#define __HAVE_68881__ 1
#define __STRICT_ANSI__ 1
#define __mc68000 1
#define __mc68000__ 1
#define __mc68020 1
#define __mc68020__ 1
#define __rtems 1
#define __rtems__ 1

---
Eric Norum                                 eric at skatter.usask.ca
Saskatchewan Accelerator Laboratory        Phone: (306) 966-6308
University of Saskatchewan                 FAX:   (306) 966-6058
Saskatoon, Canada.