[
https://issues.apache.org/jira/browse/AXIS2C-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Lazarski resolved AXIS2C-1367.
-------------------------------------
Fix Version/s: 2.0.0
Resolution: Fixed
The %I32d and %I32u format specifiers are not supported by Visual C++ 6.0
(_MSC_VER <= 1200), which outputs the literal string "I32d" instead of
formatting the integer. This led to invalid SOAP messages.
Add _MSC_VER >= 1300 check within the WIN32 block to use %d/%u for older
compilers. Also clean up nonsensical _MSC_VER check in non-Windows block.
> sprintf format I32d not supported by Visual C++ 6.0
> ---------------------------------------------------
>
> Key: AXIS2C-1367
> URL: https://issues.apache.org/jira/browse/AXIS2C-1367
> Project: Axis2-C
> Issue Type: Bug
> Components: util
> Affects Versions: 1.4.0, 1.4.1, 1.5.0, 1.6.0
> Environment: Microsoft Windows
> Visual C++ 6.0
> Reporter: Eric Hsiung
> Priority: Major
> Fix For: 2.0.0
>
>
> The following are defined in axutil_utils_defines.h:
> #if defined(WIN32)
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%I64d"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%I64u"
> #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%I32d"
> #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%I32u"
> #else
> #if __WORDSIZE == 64
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%ld"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%lu"
> #else
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%lld"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%llu"
> #endif
> #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%d"
> #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%u"
> #endif
> Microsoft Visual C++ 6.0 does not support I32 in the format string (though it
> does support I64).
> sprintf(szBuf, AXIS2_PRINTF_INT32_FORMAT_SPECIFIER, 123456) yields the string
> "I32d".
> This of course leads to invalid SOAP messages and various errors.
> The fix is to use _MSC_VER to conditionally compile different format strings
> for VC++6 versus later versions of VC++ (which do support I32) like this:
> #if defined(WIN32)
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%I64d"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%I64u"
> #if _MSC_VER > 1200
> #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%I32d"
> #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%I32u"
> #else
> #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%d"
> #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%u"
> #endif
> #else
> #if __WORDSIZE == 64
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%ld"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%lu"
> #else
> #define AXIS2_PRINTF_INT64_FORMAT_SPECIFIER "%lld"
> #define AXIS2_PRINTF_UINT64_FORMAT_SPECIFIER "%llu"
> #endif
> #define AXIS2_PRINTF_INT32_FORMAT_SPECIFIER "%d"
> #define AXIS2_PRINTF_UINT32_FORMAT_SPECIFIER "%u"
> #endif
> AXIS2C-1295 seems to be referring to this problem as well.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]