[Ace-users] [ace-bugs] Problem with os_intrin.h
Juraj Ivančić
juraj.ivancic at gmail.com
Mon Jul 16 15:01:35 CDT 2007
ACE VERSION: 5.5.9
HOST MACHINE and OPERATING SYSTEM:
Intel Pentium M, Windows XP SP2, Winsock2
COMPILER NAME AND VERSION (AND PATCHLEVEL):
Visual Studio 7.1
THE $ACE_ROOT/ace/config.h: config-win32.h
DOES THE PROBLEM AFFECT:
COMPILATION?
Possibly. In case another library which declares these functions
is used.
Also, because wrong variable has volatile modifier, the compiler
might
theoretically produce invalid code.
LINKING? No.
EXECUTION? No.
ACE is affected.
SYNOPSIS:
Out of date declarations in os_intrin.h
DESCRIPTION:
Declarations of the following two intrinsic functions in os_intrin.h
might be out of date.
LONG __cdecl _InterlockedExchange (LPLONG volatile Target, LONG Value);
LONG __cdecl _InterlockedExchangeAdd (LPLONG volatile Addend, LONG Value);
should be redeclared as
LONG __cdecl _InterlockedExchange (LONG volatile * Target, LONG Value);
LONG __cdecl _InterlockedExchangeAdd (LONG volatile * Addend, LONG Value);
The former declarations, which are used by ACE, are copy-pasted from the
referenced
MSDN article
(http://msdn2.microsoft.com/en-us/library/f24ya7ct(VS.71).aspx).
However, I believe that this article is incorrect. Logically - pointee
is volatile, not the pointer.
I detected this because ACE conflicted with the declarations used by the
Boost 1.34 library
(boost/detail/interlocked.hpp).
Newer MSDN articles (e.g.
http://msdn2.microsoft.com/en-us/library/ms683590.aspx)
also contain the latter function signatures.
More information about the Ace-users
mailing list