__uuidof and CodeGuard


2007-10-18 05:21:21 PM
cppbuilder66
CB2007/SP2. CodeGuard reports access overrun with the following code.
If you called TestFunc only once, no access overrun. Is this a bug of
the compiler or CodeGuard? Or did I miss something?
#include <unknwn.h>
char TestFunc(const GUID& val)
{
return *(reinterpret_cast<const char*>(&val)+1);
}
int main(int,char*[])
{
TestFunc(__uuidof(IUnknown));
TestFunc(__uuidof(IUnknown));
return 0;
}