Environment
Fedora 29, gcc 8.3.1, running Kickstart downloaded 2021-07-23
Problem/Question
While compiling, the compiler emitted these warnings:
GEN netdata
In function 'update_disk_table',
inlined from 'read_local_disks' at collectors/ebpf.plugin/ebpf_disk.c:347:13:
collectors/ebpf.plugin/ebpf_disk.c:292:9: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(disk_list->family, name, length);
^
collectors/ebpf.plugin/ebpf_disk.c: In function 'read_local_disks':
collectors/ebpf.plugin/ebpf_disk.c:288:18: note: length computed here
length = strlen(name);
^
In function 'update_disk_table',
inlined from 'read_local_disks' at collectors/ebpf.plugin/ebpf_disk.c:347:13:
collectors/ebpf.plugin/ebpf_disk.c:280:9: warning: 'strncpy' specified bound depends on the length of the source argument [-Wstringop-overflow=]
strncpy(w->family, name, length);
^
collectors/ebpf.plugin/ebpf_disk.c: In function 'read_local_disks':
collectors/ebpf.plugin/ebpf_disk.c:276:18: note: length computed here
length = strlen(name);
^
What I expected to happen
No warnings.