4 Commits

Author SHA1 Message Date
8fa17e0f15 Tell C++11 compilers to generate default copy operator
Recent compilers complain about using memcpy on a class with non-trivial
copy-assignment operator. However, this is used in the the impementation
of that operator. Avoid in C++11 in favor of explicitly asking for the default.
2025-09-03 17:50:02 +02:00
ace5da0dfd Fix compiler warning about mismatching signedness 2025-09-03 17:49:47 +02:00
edcbf03505 Address of variable can never be NULL 2025-09-03 17:49:29 +02:00
b1f8777606 Don't unreference pdd with borrowed memory buf
This can lead to memory being deleted twice.
2025-09-03 17:45:32 +02:00
4 changed files with 5 additions and 4 deletions

View File

@@ -114,7 +114,11 @@ inline void gdd::setStatSevr(aitInt16 stat, aitInt16 sevr)
{ status.s.aitStat = stat; status.s.aitSevr = sevr; }
inline gdd& gdd::operator=(const gdd& v)
#if __cplusplus >= 201103L
= default;
#else
{ memcpy(this,&v,sizeof(gdd)); return *this; }
#endif
inline int gdd::isScalar(void) const { return dimension()==0?1:0; }
inline int gdd::isContainer(void) const

View File

@@ -307,7 +307,6 @@ void gdd::test()
pdd->convertAddressToOffsets();
pdd->convertOffsetsToAddress();
pdd->dump();
pdd->unreference();
delete [] buf;
}
#endif
@@ -509,7 +508,6 @@ void gddContainer::test(void)
cdd1->dump();
fprintf(stderr,"=====RE-DUMP OF ORIGINAL CONTAINER:\n");
dump();
cdd1->unreference();
delete [] buf;
// test copy(), Dup(), copyInfo()

View File

@@ -24,7 +24,6 @@
casCoreClient::casCoreClient ( caServerI & serverInternal ) :
eventSys ( *this )
{
assert ( & serverInternal );
ctx.setServer ( & serverInternal );
ctx.setClient ( this );
}

View File

@@ -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) ) {
char sockErrBuf[64], buf[64];
epicsSocketConvertErrnoToString ( sockErrBuf, sizeof ( sockErrBuf ) );
ipAddrToA ( &pAddr->addr.ia, buf, sizeof(buf) );