Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-677

[IBM XLC++ 9.0/AIX 5.3] tr1/cstdint limit macros incompatible with system provided C headers

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 4.2.0
    • Fix Version/s: 4.2.1
    • Labels:
      None
    • Severity:
      Compiler Error

      Description

      The following testcase fails to compile because both the C library stdint.h and our tr1/cstdint headers define defines the C99 limit macros. It looks like we need to avoid defining the macros if a previous definition already exists. Is that a sufficient solution? What if our defintion is different for some reason?

      $ cat u.cpp && gmake u
      #include <cstring>
      #include <tr1/cstdint>
      
      xlCcore -c -I/amd/devco/vitek/stdcxx/trunk/include/ansi -D_RWSTDDEBUG    -I/amd/devco/vitek/stdcxx/trunk/include -I/build/vitek/11s/include -I/amd/devco/vitek/stdcxx/trunk/tests/include  -g     -qtemplateregistry=u.ti u.cpp
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 56.11: 1540-0848 (S) The macro name "INT8_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 142.9: 1540-0425 (I) "INT8_MAX" is defined on line 142 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 57.11: 1540-0848 (S) The macro name "UINT8_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 149.9: 1540-0425 (I) "UINT8_MAX" is defined on line 149 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 116.11: 1540-0848 (S) The macro name "INT16_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 143.9: 1540-0425 (I) "INT16_MAX" is defined on line 143 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 117.11: 1540-0848 (S) The macro name "UINT16_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 150.9: 1540-0425 (I) "UINT16_MAX" is defined on line 150 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 171.13: 1540-0848 (S) The macro name "INT32_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 144.9: 1540-0425 (I) "INT32_MAX" is defined on line 144 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 172.13: 1540-0848 (S) The macro name "UINT32_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 151.9: 1540-0425 (I) "UINT32_MAX" is defined on line 151 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 225.13: 1540-0848 (S) The macro name "INT64_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 146.9: 1540-0425 (I) "INT64_MAX" is defined on line 146 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 226.13: 1540-0848 (S) The macro name "UINT64_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 153.9: 1540-0425 (I) "UINT64_MAX" is defined on line 153 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 323.9: 1540-0848 (S) The macro name "PTRDIFF_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 222.9: 1540-0425 (I) "PTRDIFF_MIN" is defined on line 222 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 324.9: 1540-0848 (S) The macro name "PTRDIFF_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 223.9: 1540-0425 (I) "PTRDIFF_MAX" is defined on line 223 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 326.9: 1540-0848 (S) The macro name "SIZE_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 246.9: 1540-0425 (I) "SIZE_MAX" is defined on line 246 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 328.9: 1540-0848 (S) The macro name "WCHAR_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 236.9: 1540-0425 (I) "WCHAR_MIN" is defined on line 236 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 329.9: 1540-0848 (S) The macro name "WCHAR_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 234.9: 1540-0425 (I) "WCHAR_MAX" is defined on line 234 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 331.9: 1540-0848 (S) The macro name "WINT_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 239.9: 1540-0425 (I) "WINT_MIN" is defined on line 239 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 332.9: 1540-0848 (S) The macro name "WINT_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 240.9: 1540-0425 (I) "WINT_MAX" is defined on line 240 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 334.9: 1540-0848 (S) The macro name "SIG_ATOMIC_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 226.9: 1540-0425 (I) "SIG_ATOMIC_MIN" is defined on line 226 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 335.9: 1540-0848 (S) The macro name "SIG_ATOMIC_MAX" is already defined with a different definition.
      "/usr/include/stdint.h", line 227.9: 1540-0425 (I) "SIG_ATOMIC_MAX" is defined on line 227 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 339.9: 1540-0848 (S) The macro name "INT8_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 135.9: 1540-0425 (I) "INT8_MIN" is defined on line 135 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 340.9: 1540-0848 (S) The macro name "INT16_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 136.9: 1540-0425 (I) "INT16_MIN" is defined on line 136 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 341.9: 1540-0848 (S) The macro name "INT32_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 137.9: 1540-0425 (I) "INT32_MIN" is defined on line 137 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 342.9: 1540-0848 (S) The macro name "INT64_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 139.9: 1540-0425 (I) "INT64_MIN" is defined on line 139 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 344.9: 1540-0848 (S) The macro name "INT_LEAST8_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 156.9: 1540-0425 (I) "INT_LEAST8_MIN" is defined on line 156 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 345.9: 1540-0848 (S) The macro name "INT_LEAST16_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 157.9: 1540-0425 (I) "INT_LEAST16_MIN" is defined on line 157 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 346.9: 1540-0848 (S) The macro name "INT_LEAST32_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 158.9: 1540-0425 (I) "INT_LEAST32_MIN" is defined on line 158 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 347.9: 1540-0848 (S) The macro name "INT_LEAST64_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 160.9: 1540-0425 (I) "INT_LEAST64_MIN" is defined on line 160 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 349.9: 1540-0848 (S) The macro name "INT_FAST8_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 177.9: 1540-0425 (I) "INT_FAST8_MIN" is defined on line 177 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 350.9: 1540-0848 (S) The macro name "INT_FAST16_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 178.9: 1540-0425 (I) "INT_FAST16_MIN" is defined on line 178 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 351.9: 1540-0848 (S) The macro name "INT_FAST32_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 179.9: 1540-0425 (I) "INT_FAST32_MIN" is defined on line 179 of "/usr/include/stdint.h".
      "/amd/devco/vitek/stdcxx/trunk/include/tr1/cstdint", line 352.9: 1540-0848 (S) The macro name "INT_FAST64_MIN" is already defined with a different definition.
      "/usr/include/stdint.h", line 181.9: 1540-0425 (I) "INT_FAST64_MIN" is defined on line 181 of "/usr/include/stdint.h".
      gmake: *** [u.o] Error 1
      
      $ grep "INT8_MAX" /usr/include/stdint.h
      #define INT8_MAX        (127)
      #define UINT8_MAX       (255U)
      #define INT_LEAST8_MAX  INT8_MAX
      #define UINT_LEAST8_MAX         UINT8_MAX
      #define INT_FAST8_MAX   INT8_MAX
      #define UINT_FAST8_MAX  UINT8_MAX
      
      $ grep "INT8_MAX" /nfs/devco/vitek/stdcxx/trunk/include/tr1/cstdint 
      #  define INT8_MAX          127
      #  define UINT8_MAX         255U
      #  define INT_LEAST8_MAX    INT8_MAX
      #  define UINT_LEAST8_MAX   UINT8_MAX
      #  define INT_FAST8_MAX     INT8_MAX
      #  define UINT_FAST8_MAX    UINT8_MAX
      #define INT8_MIN            _RWSTD_T_MIN (INT8_MAX)
      $ 
      

        Attachments

        1. 8.cstdint.stdcxx-677.cpp
          1 kB
          Travis Vitek
        2. stdcxx-677.patch
          2 kB
          Travis Vitek

          Activity

            People

            • Assignee:
              vitek Travis Vitek
              Reporter:
              vitek Travis Vitek

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment