Skip to content

Build issue Ubuntu 21.10 GCC11.2 #125

@micron10

Description

@micron10

Hi
Try to build on ubuntu 21.10 with GCC 11.2 but get this error:

In file included from /usr/include/string.h:519,
from stand/npf_stand.h:26,
from npf.h:21,
from npf_impl.h:37,
from npf_rproc.c:25:
In function ‘stpncpy’,
inlined from ‘strlcpy’ at stand/npf_stand.h:236:8,
inlined from ‘npf_ext_register’ at npf_rproc.c:113:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:103:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
103 | return __builtin___stpncpy_chk (__dest, __src, __n,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/string.h:519,
from stand/npf_stand.h:26,
from npf.h:21,
from npf_impl.h:37,
from npf_if.c:45:
In function ‘stpncpy’,
inlined from ‘strlcpy’ at stand/npf_stand.h:236:8,
inlined from ‘npf_ifmap_copylogname’ at npf_if.c:189:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:103:10: error: ‘__builtin_strncpy’ output may be truncated copying between 0 and 16 bytes from a string of length 16 [-Werror=stringop-truncation]
103 | return __builtin___stpncpy_chk (__dest, __src, __n,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
In function ‘stpncpy’,
inlined from ‘strlcpy’ at stand/npf_stand.h:236:8,
inlined from ‘npf_rproc_create’ at npf_rproc.c:279:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:103:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
103 | return __builtin___stpncpy_chk (__dest, __src, __n,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
npf_if.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
In file included from /usr/include/string.h:519,
from stand/npf_stand.h:26,
from npf.h:21,
from npf_impl.h:37,
from npf_tableset.c:43:
In function ‘stpncpy’,
inlined from ‘strlcpy’ at stand/npf_stand.h:236:8,
inlined from ‘npf_table_create’ at npf_tableset.c:350:2:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:103:10: error: ‘__builtin_strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
103 | return __builtin___stpncpy_chk (__dest, __src, __n,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
npf_rproc.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:90: build/npf_if.lo] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:90: build/npf_rproc.lo] Error 1
In file included from /usr/include/string.h:519,
from stand/npf_stand.h:26,
from npf.h:21,
from npf_impl.h:37,
from npf_ruleset.c:32:
In function ‘stpncpy’,
inlined from ‘strlcpy’ at stand/npf_stand.h:236:8,
inlined from ‘npf_rule_alloc’ at npf_ruleset.c:601:3:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:103:10: error: ‘__builtin_strncpy’ specified bound 64 equals destination size [-Werror=stringop-truncation]
103 | return __builtin___stpncpy_chk (__dest, __src, __n,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 | __glibc_objsize (__dest));
| ~~~~~~~~~~~~~~~~~~~~~~~~~
npf_tableset.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:90: build/npf_tableset.lo] Error 1
npf_ruleset.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:90: build/npf_ruleset.lo] Error 1
make[1]: Leaving directory '/build/npf/npf-master/pkg/SOURCES/kern'
make: *** [Makefile:11: all] Error 2

And second :

npf.c: In function ‘_npf_table_build_const.part.0’:
npf.c:1198:13: error: ‘cdbw_output’ reading 16 bytes from a region of size 14 [-Werror=stringop-overread]
1198 | if (cdbw_output(cdbw, fd, "npf-table-cdb", NULL) == -1) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
npf.c:1198:13: note: referencing argument 3 of type ‘const char *’
In file included from npf.c:53:
/usr/include/cdbw.h:53:18: note: in a call to function ‘cdbw_output’
53 | int cdbw_output(struct cdbw *, int, const char[16],
| ^~~~~~~~~~~
npf.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make[1]: *** [Makefile:70: npf.lo] Error 1

And app build have problem with dpdk 20.11

arp.c: In function ‘arp_input’:
arp.c:215:24: error: taking address of packed member of ‘struct rte_arp_ipv4’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
215 | arp_cache(ifp, &arp->arp_sip, &arp->arp_sha, targeted);
| ^~~~~~~~~~~~~
arp.c: At top level:
cc1: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make: *** [: arp.o] Error 1

m.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions