[LLVMbugs] [Bug 11028] New: clang trunk r140637 is not defining preprocessor macros correctly on linux/ppc64

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 27 22:21:15 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11028

           Summary: clang trunk r140637 is not defining preprocessor
                    macros correctly on linux/ppc64
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jeremyhu at apple.com
                CC: llvmbugs at cs.uiuc.edu


clang is not defining __linux__ and similar macros, its processor definitions
are like on darwin (__ppc64__ rather than __PPC64__)

__SIZEOF_LONG_DOUBLE__ is also incorrect which is probably a deeper issue, but
I only care about getting the static analyzer working at this point, so that's
not as big of a concern to me as the others.  Missing __linux__ causes things
to be preprocessed incorrectly.


$ /opt/llvm/bin/clang --version
clang version 3.0 (trunk 140637)
Target: powerpc64-unknown-linux-gnu
Thread model: posix

$ /usr/bin/gcc --version
gcc (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ echo "" | /opt/llvm/bin/clang -E - -dM | sort > /tmp/clang.dM
$ echo "" | /usr/bin/gcc -E - -dM | sort > /tmp/gcc.dM
$ comm -3 /tmp/*.dM
    #define _ARCH_PPCGR 1
    #define __BIGGEST_ALIGNMENT__ 16
    #define _CALL_AIX 1
    #define _CALL_AIXDESC 1
    #define __CHAR16_TYPE__ short unsigned int
#define __CHAR16_TYPE__ unsigned short
#define __clang__ 1
#define __clang_major__ 3
#define __clang_minor__ 0
#define __clang_patchlevel__ 0
#define __clang_version__ "3.0 (trunk 140637)"
#define __CONSTANT_CFSTRINGS__ 1
    #define __DEC128_EPSILON__ 1E-33DL
    #define __DEC128_MANT_DIG__ 34
    #define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
    #define __DEC128_MAX_EXP__ 6145
    #define __DEC128_MIN__ 1E-6143DL
    #define __DEC128_MIN_EXP__ (-6142)
    #define __DEC128_SUBNORMAL_MIN__
0.000000000000000000000000000000001E-6143DL
    #define __DEC32_EPSILON__ 1E-6DF
    #define __DEC32_MANT_DIG__ 7
    #define __DEC32_MAX__ 9.999999E96DF
    #define __DEC32_MAX_EXP__ 97
    #define __DEC32_MIN__ 1E-95DF
    #define __DEC32_MIN_EXP__ (-94)
    #define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
    #define __DEC64_EPSILON__ 1E-15DD
    #define __DEC64_MANT_DIG__ 16
    #define __DEC64_MAX__ 9.999999999999999E384DD
    #define __DEC64_MAX_EXP__ 385
    #define __DEC64_MIN__ 1E-383DD
    #define __DEC64_MIN_EXP__ (-382)
    #define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
    #define __DEC_EVAL_METHOD__ 2
#define __DECIMAL_DIG__ 17
    #define __DECIMAL_DIG__ 33
    #define __ELF__ 1
    #define _FORTIFY_SOURCE 2
    #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 __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1
    #define __GNUC_GNU_INLINE__ 1
#define __GNUC_MINOR__ 2
    #define __GNUC_MINOR__ 4
#define __GNUC_PATCHLEVEL__ 1
    #define __GNUC_PATCHLEVEL__ 5
#define __GNUC_STDC_INLINE__ 1
    #define __gnu_linux__ 1
#define __GXX_RTTI 1
#define __INT16_TYPE__ short
#define __INT32_TYPE__ int
#define __INT64_C_SUFFIX__ L
#define __INT64_TYPE__ long int
#define __INT8_TYPE__ char
#define __INTMAX_WIDTH__ 64
#define __INTPTR_TYPE__ long int
#define __INTPTR_WIDTH__ 64
    #define __LDBL_DENORM_MIN__ 4.94065645841246544176568792868221e-324L
#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324
#define __LDBL_DIG__ 15
    #define __LDBL_DIG__ 31
#define __LDBL_EPSILON__ 2.2204460492503131e-16
    #define __LDBL_EPSILON__ 4.94065645841246544176568792868221e-324L
    #define __LDBL_MANT_DIG__ 106
#define __LDBL_MANT_DIG__ 53
#define __LDBL_MAX__ 1.7976931348623157e+308
    #define __LDBL_MAX__ 1.79769313486231580793728971405301e+308L
    #define __LDBL_MIN_10_EXP__ (-291)
#define __LDBL_MIN_10_EXP__ (-307)
    #define __LDBL_MIN__ 2.00416836000897277799610805135016e-292L
#define __LDBL_MIN__ 2.2250738585072014e-308
#define __LDBL_MIN_EXP__ (-1021)
    #define __LDBL_MIN_EXP__ (-968)
    #define __linux 1
    #define __linux__ 1
    #define linux 1
#define __llvm__ 1
    #define __LONGDOUBLE128 1
#define __NATURAL_ALIGNMENT__ 1
#define __POINTER_WIDTH__ 64
#define __POWERPC__ 1
#define __ppc__ 1
    #define __PPC__ 1
#define __ppc64__ 1
    #define __PPC64__ 1
#define __PTRDIFF_WIDTH__ 64
#define __SIG_ATOMIC_WIDTH__ 32
    #define __SIZEOF_LONG_DOUBLE__ 16
#define __SIZEOF_LONG_DOUBLE__ 8
#define __SIZE_WIDTH__ 64
#define __STDC_VERSION__ 199901L
    #define __unix 1
    #define __unix__ 1
    #define unix 1
    #define __USER_LABEL_PREFIX__ 
#define __USER_LABEL_PREFIX__ _
#define __VERSION__ "4.2.1 Compatible Clang 3.0 (trunk 140637)"
    #define __VERSION__ "4.4.5"
#define __WCHAR_WIDTH__ 32
#define __WINT_TYPE__ int
    #define __WINT_TYPE__ unsigned int
#define __WINT_WIDTH__ 32

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list