NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

toolchain/58969: use of alloca is warning, not error, with -std=c11



>Number:         58969
>Category:       toolchain
>Synopsis:       use of alloca is warning, not error, with -std=c11
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 07 06:10:00 +0000 2025
>Originator:     Taylor R Campbell
>Release:        current
>Organization:
The NetBSD Foundalloca
>Environment:
>Description:
While experimenting with switching the build to -std=c11 (https://mail-index.netbsd.org/tech-kern/2025/01/05/msg029919.html), I saw warnings fly by like this:

/home/riastradh/netbsd/current/obj.riscv/tooldir/bin/../lib/gcc/riscv64--netbsd/12.4.0/../../../../riscv64--netbsd/bin/ld: /home/riastradh/netbsd/current/src/../obj.riscv/destdir.riscv/lib/libc.so: warning: Warning: reference to the libc supplied alloca(3); this most likely will not work. Please use the compiler provided version of alloca(3), by supplying the appropriate compiler flags (e.g. -std=gnu99).

We can easily address these by using -std=gnu11 for the handful of files that use alloca, like execlp.c, but this has to be a build error so we don't accidentally miss the warning scrolling past in build output.
>How-To-Repeat:
1. change -std=gnu99 to -std=c11 in share/mk/bsd.sys.mk
2. build libc and anything that uses it
>Fix:
Yes, please!



Home | Main Index | Thread Index | Old Index