https://sourceware.org/bugzilla/show_bug.cgi?id=32093
Bug ID: 32093
Summary: -Walloc-size warning in ctf-hash.c
Product: binutils
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libctf
Assignee: unassigned at sourceware dot org
Reporter: sam at gentoo dot org
Target Milestone: ---
I haven't investigated it at all, just noticed it in the log while looking at
something else.
```
libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I.
-I/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf
-D_GNU_SOURCE
-I/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf
-I/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/../include
-I/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/../bfd
-I../bfd -DNOBFD=1 -std=gnu99 -Wall -W -Wall -Wno-narrowing -Wwrite-strings
-Wmissing-format-attribute -Wstrict-prototypes -Wmissing-prototypes
-Wold-style-definition -pedantic -Wno-long-long -O3 -march=native
-mtls-dialect=gnu2 -fdiagnostics-color=always -pipe -Werror=strict-aliasing
-Werror=lto-type-mismatch -Werror=odr -frecord-gcc-switches -ggdb3
-fprofile-generate -flto=jobserver -ffat-lto-objects -c
/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/ctf-hash.c
-fPIC -DPIC -o .libs/libctf_nobfd_la-ctf-hash.o
/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/ctf-hash.c:
In function ‘ctf_dynhash_create_sized’:
/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/ctf-hash.c:167:13:
warning: allocation of insufficient size ‘8’ for type ‘ctf_dynhash_t’ {aka
‘struct ctf_dynhash’} with size ‘24’ [-Walloc-size]
167 | dynhash = malloc (offsetof (ctf_dynhash_t, key_free));
| ^
/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/ctf-hash.c:
In function ‘ctf_hashtab_insert’:
/var/tmp/portage/sys-devel/binutils-2.43/work/binutils-2.43/libctf/ctf-hash.c:228:15:
warning: allocation of insufficient size ‘16’ for type ‘ctf_helem_t’ {aka
‘struct ctf_helem’} with size ‘24’ [-Walloc-size]
228 | *slot = malloc (offsetof (ctf_helem_t, owner));
| ^
```
--
You are receiving this mail because:
You are on the CC list for the bug.