-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix compiler warnings #11
base: master
Are you sure you want to change the base?
Fix compiler warnings #11
Conversation
This can lead to memory deleted twice.
Recent compilers complain about using memset on a class with non-trivial copy-assignment operator. However, this is used in the the impementation of that operator. Cast to void* to silence the warning.
@@ -114,7 +114,7 @@ inline void gdd::setStatSevr(aitInt16 stat, aitInt16 sevr) | |||
{ status.s.aitStat = stat; status.s.aitSevr = sevr; } | |||
|
|||
inline gdd& gdd::operator=(const gdd& v) | |||
{ memcpy(this,&v,sizeof(gdd)); return *this; } | |||
{ memcpy(static_cast<void*>(this),&v,sizeof(gdd)); return *this; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recent compilers complain about using memset on a class with non-trivial
copy-assignment operator. However, this is used in the the impementation
of that operator. Cast to void* to silence the warning.
pdd->unreference(); | ||
delete [] buf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't unreferenced pdd with borrowed memory buf
This can lead to double delete.
@@ -24,7 +24,6 @@ | |||
casCoreClient::casCoreClient ( caServerI & serverInternal ) : | |||
eventSys ( *this ) | |||
{ | |||
assert ( & serverInternal ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address of variable can never be NULL.
@@ -423,7 +423,7 @@ void casDGIntfIO::sendBeaconIO ( char & msg, unsigned length, | |||
osiSockAddrNode *pAddr = reinterpret_cast<osiSockAddrNode *>(pNode); | |||
|
|||
ssize_t status = sendto(this->beaconSock, &msg, length, 0, &pAddr->addr.sa, sizeof(pAddr->addr.ia)); | |||
if ( status != length ) { | |||
if ( status != static_cast<ssize_t>(length) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed/unsigned mismatch
No description provided.