Am 16.11.2011 22:17, schrieb tfaber@svn.reactos.org:
Author: tfaber Date: Wed Nov 16 21:17:38 2011 New Revision: 54401
URL: http://svn.reactos.org/svn/reactos?rev=54401&view=rev Log: [ATL] - Fix buffer overflow in CComDynamicUnkArray::Add. Found by Coverity (CID 2474) [NDK] - Remove meaningless const attribute from pointer rvalues to make Coverity's life easier
-#define SharedUserData ((KUSER_SHARED_DATA *CONST)USER_SHARED_DATA) +#define SharedUserData ((KUSER_SHARED_DATA *)USER_SHARED_DATA)
It is like this (with the const) in wdm.h
#define SharedUserData ((KUSER_SHARED_DATA * const) KI_USER_SHARED_DATA)
maybe its supposed to express that "SharedUserData" is a constant and not a variable... although that doesn't make much sense
On 2011-11-17 12:07, Timo Kreuzer wrote:
Am 16.11.2011 22:17, schrieb tfaber@svn.reactos.org:
-#define SharedUserData ((KUSER_SHARED_DATA *CONST)USER_SHARED_DATA) +#define SharedUserData ((KUSER_SHARED_DATA *)USER_SHARED_DATA)
It is like this (with the const) in wdm.h
#define SharedUserData ((KUSER_SHARED_DATA * const) KI_USER_SHARED_DATA)
maybe its supposed to express that "SharedUserData" is a constant and not a variable... although that doesn't make much sense
Hmm. Interesting. Didn't spot it in wdm.h. Thanks!
Apparently, MS doesn't use Coverity (what a shock :D)
It could certainly be argued that it has some value as an annotation. But since the const is neither wrong in any way nor makes any difference at all, I think ~300 Coverity parse warnings are a good reason to remove it.
I'll fix it in our wdm.h too later, unless someone disagrees.
Thanks,
Tom
On 17.11.2011 16:09, Thomas Faber wrote:
Apparently, MS doesn't use Coverity (what a shock :D)
Apparently, they have Prefast :-)