Comment 17 for bug 1905159

Revision history for this message
Jerzy Tarasiuk (tarasiukj) wrote :

The arg change mentioned previously is for the program from #15, containing
a function from modules/libcom/test/epicsStackTraceTest.c for which the GCC
issues a warning " specified bound depends on the length of the source
 argument [-Wstringop-overflow=]". Now on another kind of warning, like:
"specified bound 64 equals destination size [-Wstringop-truncation]"
this or similar warning is produced from the following:

modules/ca/src/client/msgForMultiplyDefinedPV.cpp lines 44 and 46
    strncpy ( this->acc, pAcc, sizeof ( this->acc ) );
    strncpy ( this->channel, pChannelName, sizeof ( this->channel ) );
modules/ca/src/perl/Cap5.xs lines 602 and 694 (here 40, not 64)
- both: strncpy(data.dbr_string, SvPV_nolen(val), MAX_STRING_SIZE);

If the stored value is to contain a terminator, may specify one character
less as arg3 od strncpy, and store 0 in the last character - the message
means that storing the entire destination was tried (leaving no space for
the terminator). Or... disable the -Wstringop-truncation ?