There are some warnings from gcc 8.3.0 (and above) on biRecord.c and on boRecord.c similar to this one (from 3.15 branch):
../../../src/std/rec/biRecord.c: In function ‘get_enum_str’:
../../../src/std/rec/biRecord.c:165:35: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof-pointer-memaccess]
strncpy(pstring,prec->znam,sizeof(prec->znam));
---
I think it looks a place where a problem could occur if the size of znam is greater than pstring. If we are sure this is not an issue, we could solve the warning using a fixed length (on the biRecord and boRecord case, znam and onam have length 26).
On that case, could make sense to have a constant for onam, znam (and others similar) length.
There are some warnings from gcc 8.3.0 (and above) on biRecord.c and on boRecord.c similar to this one (from 3.15 branch):
../../. ./src/std/ rec/biRecord. c: In function ‘get_enum_str’: ./src/std/ rec/biRecord. c:165:35: warning: argument to ‘sizeof’ in ‘strncpy’ call is the same expression as the source; did you mean to use the size of the destination? [-Wsizeof- pointer- memaccess] pstring, prec->znam, sizeof( prec->znam) );
../../.
strncpy(
---
I think it looks a place where a problem could occur if the size of znam is greater than pstring. If we are sure this is not an issue, we could solve the warning using a fixed length (on the biRecord and boRecord case, znam and onam have length 26).
On that case, could make sense to have a constant for onam, znam (and others similar) length.
Does it make sense?
Any other suggestion ?