When using newlib with anything and compiling with gcc-11 hundreds of warnings are shown regarding alloc_size.
These warnings have the following format:
In file included from /home/***/.unikraft/libs/newlib/include/stdlib.h:37,
from /home/***/.unikraft/apps/hello-test/build/libnewlibc/origin/newlib-2.5.0.20170922/newlib/libc/argz/envz_remove.c:10:
/home/***/.unikraft/apps/hello-test/build/libnewlibc/origin/newlib-2.5.0.20170922/newlib/libc/include/stdlib.h:144:13: warning: ignoring attribute ‘alloc_size (3)’ because it conflicts with previous ‘alloc_size (2)’ [-Wattributes]
144 | __alloc_size(3);
|
This is because chained alloc_size attributes are deprecated in gcc-11.
To fix this, multiple arguments are given to alloc_size as per the documentation.
This has been fixed in newer versions of newlib. The patch that fixes this issue will no longer apply when bumping the version.
I will add these fixes as a Pull Request and link this issue.
When using
newlib
with anything and compiling withgcc-11
hundreds of warnings are shown regardingalloc_size
.These warnings have the following format:
This is because chained
alloc_size
attributes are deprecated ingcc-11
. To fix this, multiple arguments are given toalloc_size
as per the documentation.This has been fixed in newer versions of
newlib
. The patch that fixes this issue will no longer apply when bumping the version.I will add these fixes as a Pull Request and link this issue.