ZABBIX BUGS AND ISSUES
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-10375

Define our own zbx_int32_t instead of using common name uint32_t

    Details

      Description

      One can spot the following piece in mbed tls library sources:

      #ifdef _MSC_VER
      #include <basetsd.h>
      typedef UINT32 uint32_t;
      #else
      #include <stdint.h>
      #endif
      

      This conflicts with Zabbix definition:

      #if defined(_WINDOWS)
      #	ifndef uint32_t
      #		define uint32_t	__int32
      #	endif
      #endif
      

      ...and forces us to #undef uint32_t on Windows before we include mbed tls headers, which makes the further use of uint32_t somewhat ambiguous.

      I would like to suggest defining zbx_uint32_t properly (as we define zbx_uint64_t) and use a temporary #define uint32_t zbx_uint32_t while we make continuous effort to eliminate uint32_t from Zabbix code.

        Activity

        Hide
        Viktors Tjarve added a comment -

        Compilation error message when building without #undef uint32_t on Windows:

        c:\tmp\mbedtls\include\polarssl\bignum.h(50) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?)
        c:\tmp\mbedtls\include\polarssl\bignum.h(50) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
        c:\tmp\mbedtls\include\polarssl\md5.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?)
        c:\tmp\mbedtls\include\polarssl\md5.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
        c:\tmp\mbedtls\include\polarssl\sha1.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?)
        c:\tmp\mbedtls\include\polarssl\sha1.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
        c:\tmp\mbedtls\include\polarssl\sha256.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?)
        c:\tmp\mbedtls\include\polarssl\sha256.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
        c:\tmp\mbedtls\include\polarssl\aes.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?)
        c:\tmp\mbedtls\include\polarssl\aes.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared
        ..\..\..\src\libs\zbxcomms\comms.c(1506) : warning C4018: '<' : signed/unsigned mismatch
        NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\cl.exe"' : return code '0x2'
        Stop.
        
        Show
        Viktors Tjarve added a comment - Compilation error message when building without #undef uint32_t on Windows: c:\tmp\mbedtls\include\polarssl\bignum.h(50) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?) c:\tmp\mbedtls\include\polarssl\bignum.h(50) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared c:\tmp\mbedtls\include\polarssl\md5.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?) c:\tmp\mbedtls\include\polarssl\md5.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared c:\tmp\mbedtls\include\polarssl\sha1.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?) c:\tmp\mbedtls\include\polarssl\sha1.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared c:\tmp\mbedtls\include\polarssl\sha256.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?) c:\tmp\mbedtls\include\polarssl\sha256.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared c:\tmp\mbedtls\include\polarssl\aes.h(37) : error C2628: 'UINT32' followed by '__int32' is illegal (did you forget a ';'?) c:\tmp\mbedtls\include\polarssl\aes.h(37) : warning C4091: 'typedef ' : ignored on left of 'unsigned int' when no variable is declared ..\..\..\src\libs\zbxcomms\comms.c(1506) : warning C4018: '<' : signed/unsigned mismatch NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin\cl.exe"' : return code '0x2' Stop.
        Hide
        Glebs Ivanovskis added a comment -

        Fix available in development branch svn://svn.zabbix.com/branches/dev/ZBX-10375 revision 59148.

        Show
        Glebs Ivanovskis added a comment - Fix available in development branch svn://svn.zabbix.com/branches/dev/ZBX-10375 revision 59148.
        Hide
        Andris Zeila added a comment -

        Successfully tested

        Show
        Andris Zeila added a comment - Successfully tested
        Hide
        Glebs Ivanovskis added a comment -

        Fixed in pre-3.0.2rc1 r59235, pre-3.1.0 (trunk) r59233.

        Show
        Glebs Ivanovskis added a comment - Fixed in pre-3.0.2rc1 r59235, pre-3.1.0 (trunk) r59233.

          People

          • Assignee:
            Unassigned
            Reporter:
            Glebs Ivanovskis
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: