The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,860 other subscribers

Cool little trick to show all the preset variables for your GCC/Clang compiler

Posted by jpluimers on 2016/08/30

Thanks David Berneda for sharing this a while ago:

Cool little trick to show all the preset variables for your GCC/Clang compiler:

clang -E -dM - < /dev/null

I’ve always wondered how to get these. Some are kind of surprising, especially since there are 320 of them, at least on my system.

On my system (Mavericks, I wish the sw_vers console tool would tell that): 170 lines.


OBJC_NEW_PROPERTIES 1
_LP64 1
__APPLE_CC__ 6000
__APPLE__ 1
__ATOMIC_ACQUIRE 2
__ATOMIC_ACQ_REL 4
__ATOMIC_CONSUME 1
__ATOMIC_RELAXED 0
__ATOMIC_RELEASE 3
__ATOMIC_SEQ_CST 5
__BLOCKS__ 1
__BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
__CHAR16_TYPE__ unsigned short
__CHAR32_TYPE__ unsigned int
__CHAR_BIT__ 8
__CONSTANT_CFSTRINGS__ 1
__DBL_DENORM_MIN__ 4.9406564584124654e-324
__DBL_DIG__ 15
__DBL_EPSILON__ 2.2204460492503131e-16
__DBL_HAS_DENORM__ 1
__DBL_HAS_INFINITY__ 1
__DBL_HAS_QUIET_NAN__ 1
__DBL_MANT_DIG__ 53
__DBL_MAX_10_EXP__ 308
__DBL_MAX_EXP__ 1024
__DBL_MAX__ 1.7976931348623157e+308
__DBL_MIN_10_EXP__ (-307)
__DBL_MIN_EXP__ (-1021)
__DBL_MIN__ 2.2250738585072014e-308
__DECIMAL_DIG__ 21
__DYNAMIC__ 1
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ 1090
__FINITE_MATH_ONLY__ 0
__FLT_DENORM_MIN__ 1.40129846e-45F
__FLT_DIG__ 6
__FLT_EPSILON__ 1.19209290e-7F
__FLT_EVAL_METHOD__ 0
__FLT_HAS_DENORM__ 1
__FLT_HAS_INFINITY__ 1
__FLT_HAS_QUIET_NAN__ 1
__FLT_MANT_DIG__ 24
__FLT_MAX_10_EXP__ 38
__FLT_MAX_EXP__ 128
__FLT_MAX__ 3.40282347e+38F
__FLT_MIN_10_EXP__ (-37)
__FLT_MIN_EXP__ (-125)
__FLT_MIN__ 1.17549435e-38F
__FLT_RADIX__ 2
__GCC_ATOMIC_BOOL_LOCK_FREE 2
__GCC_ATOMIC_CHAR16_T_LOCK_FREE 2
__GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
__GCC_ATOMIC_CHAR_LOCK_FREE 2
__GCC_ATOMIC_INT_LOCK_FREE 2
__GCC_ATOMIC_LLONG_LOCK_FREE 2
__GCC_ATOMIC_LONG_LOCK_FREE 2
__GCC_ATOMIC_POINTER_LOCK_FREE 2
__GCC_ATOMIC_SHORT_LOCK_FREE 2
__GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
__GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 1
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
__GNUC_MINOR__ 2
__GNUC_PATCHLEVEL__ 1
__GNUC_STDC_INLINE__ 1
__GNUC__ 4
__GXX_ABI_VERSION 1002
__GXX_RTTI 1
__INT16_TYPE__ short
__INT32_TYPE__ int
__INT64_C_SUFFIX__ LL
__INT64_TYPE__ long long int
__INT8_TYPE__ char
__INTMAX_MAX__ 9223372036854775807L
__INTMAX_TYPE__ long int
__INTMAX_WIDTH__ 64
__INTPTR_TYPE__ long int
__INTPTR_WIDTH__ 64
__INT_MAX__ 2147483647
__LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L
__LDBL_DIG__ 18
__LDBL_EPSILON__ 1.08420217248550443401e-19L
__LDBL_HAS_DENORM__ 1
__LDBL_HAS_INFINITY__ 1
__LDBL_HAS_QUIET_NAN__ 1
__LDBL_MANT_DIG__ 64
__LDBL_MAX_10_EXP__ 4932
__LDBL_MAX_EXP__ 16384
__LDBL_MAX__ 1.18973149535723176502e+4932L
__LDBL_MIN_10_EXP__ (-4931)
__LDBL_MIN_EXP__ (-16381)
__LDBL_MIN__ 3.36210314311209350626e-4932L
__LITTLE_ENDIAN__ 1
__LONG_LONG_MAX__ 9223372036854775807LL
__LONG_MAX__ 9223372036854775807L
__LP64__ 1
__MACH__ 1
__MMX__ 1
__NO_INLINE__ 1
__NO_MATH_INLINES 1
__ORDER_BIG_ENDIAN__ 4321
__ORDER_LITTLE_ENDIAN__ 1234
__ORDER_PDP_ENDIAN__ 3412
__PIC__ 2
__POINTER_WIDTH__ 64
__PRAGMA_REDEFINE_EXTNAME 1
__PTRDIFF_TYPE__ long int
__PTRDIFF_WIDTH__ 64
__REGISTER_PREFIX__
__SCHAR_MAX__ 127
__SHRT_MAX__ 32767
__SIG_ATOMIC_WIDTH__ 32
__SIZEOF_DOUBLE__ 8
__SIZEOF_FLOAT__ 4
__SIZEOF_INT128__ 16
__SIZEOF_INT__ 4
__SIZEOF_LONG_DOUBLE__ 16
__SIZEOF_LONG_LONG__ 8
__SIZEOF_LONG__ 8
__SIZEOF_POINTER__ 8
__SIZEOF_PTRDIFF_T__ 8
__SIZEOF_SHORT__ 2
__SIZEOF_SIZE_T__ 8
__SIZEOF_WCHAR_T__ 4
__SIZEOF_WINT_T__ 4
__SIZE_MAX__ 18446744073709551615UL
__SIZE_TYPE__ long unsigned int
__SIZE_WIDTH__ 64
__SSE2_MATH__ 1
__SSE2__ 1
__SSE3__ 1
__SSE_MATH__ 1
__SSE__ 1
__SSP__ 1
__SSSE3__ 1
__STDC_HOSTED__ 1
__STDC_UTF_16__ 1
__STDC_UTF_32__ 1
__STDC_VERSION__ 199901L
__STDC__ 1
__UINTMAX_TYPE__ long unsigned int
__USER_LABEL_PREFIX__ _
__VERSION__ "4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)"
__WCHAR_MAX__ 2147483647
__WCHAR_TYPE__ int
__WCHAR_WIDTH__ 32
__WINT_TYPE__ int
__WINT_WIDTH__ 32
__amd64 1
__amd64__ 1
__apple_build_version__ 6000057
__block __attribute__((__blocks__(byref)))
__clang__ 1
__clang_major__ 6
__clang_minor__ 0
__clang_patchlevel__ 0
__clang_version__ "6.0 (clang-600.0.57)"
__core2 1
__core2__ 1
__llvm__ 1
__pic__ 2
__strong
__tune_core2__ 1
__unsafe_unretained
__weak __attribute__((objc_gc(weak)))
__x86_64 1
__x86_64__ 1

–jeroen

via: Cool little trick to show all the preset variables for your GCC/Clang compiler:….

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.