Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 1/3] src: fix build warnings
On Sat, Jan 2, 2021 at 10:41 AM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> If we ever return the address of tmp, bad things are likely to happen
> regardless of the static so hopefully that never happens. Returning
> the address of a local variable basically means it will be junk
> (current hypothetical behavior), whereas returning a static means the
> function wouldn't be re-entrant (hypothetical behavior with the
> patch).
Correct, but one is more proper than the other, and it gets rid of the warning.
The best fix is to allocate one byte, especially if it's going to be
freed later on.
--
Felipe Contreras
Messages sorted by:
Reverse Date,
Date,
Thread,
Author