H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
203 stars 80 forks source link

Resolve 2 clang warnings in pfCrashHandler #1482

Closed dpogue closed 11 months ago

dpogue commented 11 months ago

clang-cl was reporting 2 warnings when compiling pfCrashHandler:

Plasma/FeatureLib/pfCrashHandler/plCrashSrv.cpp(86,46): warning: argument to
'sizeof' in 'memcpy' call is the same pointer type 'PCONTEXT' (aka '_CONTEXT
*') as the destination; expected 'struct _CONTEXT' or an explicit length
[-Wsizeof-pointer-memaccess]
        memcpy(context, ptrs->ContextRecord, sizeof(ptrs->ContextRecord));
               ~~~~~~~                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
Plasma/FeatureLib/pfCrashHandler/plWindowsStackWalker.cpp(140,5): warning:
explicitly defaulted default constructor is implicitly deleted
[-Wdefaulted-function-deleted]
    plStackWalkError() = default;
    ^
Plasma/Sources/Plasma/FeatureLib/pfCrashHandler/plWindowsStackWalker.cpp(137,26):
note: default constructor of 'plStackWalkError' is implicitly deleted because
base class 'std::runtime_error' has no default constructor
class plStackWalkError : public std::runtime_error
                         ^
Plasma/Sources/Plasma/FeatureLib/pfCrashHandler/plWindowsStackWalker.cpp(140,26):
note: replace 'default' with 'delete'
    plStackWalkError() = default;
                         ^~~~~~~
                         delete

The memcpy one seems like an actual issue in terms of behaviour...