I occassionally need to know some system dependant stuff when messing around with some C code. I keep forgetting this neat little trick

gcc -dM -E - < /dev/null

It will dump out useful things like this...

#define __DBL_MIN_EXP__ (-1021)
#define __UINT_LEAST16_MAX__ 65535
#define __FLT_MIN__ 1.17549435082228750797e-38F
#define __UINT_LEAST8_TYPE__ unsigned char
#define __INTMAX_C(c) c ## L
#define __CHAR_BIT__ 8
#define __UINT8_MAX__ 255
#define __WINT_MAX__ 4294967295U
#define __ORDER_LITTLE_ENDIAN__ 1234
#define __SIZE_MAX__ 18446744073709551615UL
#define __WCHAR_MAX__ 2147483647
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
#define __DBL_DENORM_MIN__ ((double)4.94065645841246544177e-324L)
#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
#define __FLT_EVAL_METHOD__ 0
#define __unix__ 1
#define __x86_64 1
...and so on...

Actually, have I posted the above already and just forgot?


Related posts:

Memory debuggers and garbage collectors for C/C++
Posted

Alternatives to using GOLD, Maui for accounting and banking for HPC systems
Posted

The ultimate sandbox game, ever!
Posted

Creating a git branch with no ancestry
Posted

Using gource to visualise projects stored in version control
Posted

Bookmark and Share