[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #60798] Make does not compile with GCC 11.1.0
From: |
Edward Welbourne |
Subject: |
Re: [bug #60798] Make does not compile with GCC 11.1.0 |
Date: |
Fri, 3 Dec 2021 12:26:36 +0000 |
Jouke Witteveen (3 December 2021 13:22) wrote:
> The next warning I get (GCC11) is a _return-local-addr_ warning in
> src/read.c:2534 (find_percent_cached). Maybe GCC doesn't recognize alloca as a
> heap allocation? Just guessing; this warning was not obvious to me.
alloca() is not a heap allocation:
<quote src="man alloca">
DESCRIPTION
The alloca() function allocates size bytes of space in the stack frame
of the caller. This temporary space is automatically freed when the
function that called alloca() returns to its caller.
</quote>
It is a stack allocation. So if make is returning an alloca()'d buffer,
then that is indeed a return of a local address.
Eddy.