You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to build the lib using gcc 9.3.1 then the build fails with:
make[2]: Leaving directory /builddir/build/BUILD/gvm-libs-20.8.1' [ 90%] Built target gvm_boreas_shared In file included from /usr/include/string.h:638, from /usr/include/glib-2.0/glib/gtestutils.h:30, from /usr/include/glib-2.0/glib.h:82, from /builddir/build/BUILD/gvm-libs-20.8.1/base/settings.h:30, from /builddir/build/BUILD/gvm-libs-20.8.1/base/prefs.c:28: In function 'strncpy', inlined from 'prefs_config' at /builddir/build/BUILD/gvm-libs-20.8.1/base/prefs.c:155:3: /usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' specified bound 2048 equals destination size [-Werror=stringop-truncation] 120 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors make[2]: *** [base/CMakeFiles/gvm_base_shared.dir/prefs.c.o] Error 1 make[2]: Leaving directory /builddir/build/BUILD/gvm-libs-20.8.1'
make[1]: *** [base/CMakeFiles/gvm_base_shared.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/string.h:638,
from /usr/include/glib-2.0/glib/gtestutils.h:30,
from /usr/include/glib-2.0/glib.h:82,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/../base/nvti.h:30,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.h:28,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:27:
In function 'strncpy',
inlined from 'redis_direct_conn' at /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:429:3:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
120 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c: In function 'redis_direct_conn':
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:429:3: note: length computed here
429 | strncpy (kbr->path, kb_path, strlen (kb_path));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:638,
from /usr/include/glib-2.0/glib/gtestutils.h:30,
from /usr/include/glib-2.0/glib.h:82,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/../base/nvti.h:30,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.h:28,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:27:
In function 'strncpy',
inlined from 'redis_new' at /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:396:3:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
120 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c: In function 'redis_new':
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:396:3: note: length computed here
396 | strncpy (kbr->path, kb_path, strlen (kb_path));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:638,
from /usr/include/glib-2.0/glib/gtestutils.h:30,
from /usr/include/glib-2.0/glib.h:82,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/../base/nvti.h:30,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.h:28,
from /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:27:
In function 'strncpy',
inlined from 'redis_find' at /builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:471:3:
/usr/include/bits/string3.h:120:10: error: '__builtin_strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
120 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c: In function 'redis_find':
/builddir/build/BUILD/gvm-libs-20.8.1/util/kb.c:471:3: note: length computed here
471 | strncpy (kbr->path, kb_path, strlen (kb_path));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[2]: Leaving directory /builddir/build/BUILD/gvm-libs-20.8.1' make[1]: Leaving directory /builddir/build/BUILD/gvm-libs-20.8.1'
OS: CentOS7
The text was updated successfully, but these errors were encountered:
When the code is safe, then the prama can used.
But for during this, my knowledge of the source code are to bad.
Sample:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
strncpy (buffer, config, sizeof (buffer));
#pragma GCC diagnostic pop
When I try to build the lib using gcc 9.3.1 then the build fails with:
OS: CentOS7
The text was updated successfully, but these errors were encountered: