ADOL-C
ADOL-C copied to clipboard
strncpy bound depends on the length of the source
I get the following warning when I build adolc using g++ 10.2.1:
../../../../ADOL-C/src/tapedoc/tapedoc.c: In function ‘filewrite_start’:
../../../../ADOL-C/src/tapedoc/tapedoc.c:57:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
57 | strncpy(fileName, baseName, strlen(baseName));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../../ADOL-C/src/tapedoc/tapedoc.c:59:5: warning: ‘strncpy’ specified bound depends on the length of the source argument [-Wstringop-overflow=]
59 | strncpy(fileName+strlen(baseName)+num, extension, strlen(extension));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~