zsh-workers
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Mikael Magnusson <mikachu@gmail.com>
Cc: Daniel Shahaf <d.s@daniel.shahaf.name>,
	Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH 1/3] src: fix build warnings
Date: Sat, 2 Jan 2021 12:30:11 -0600	[thread overview]
Message-ID: <CAMP44s05KAVSWP90NeZ5DnUOSTkKF4eEmFJqHCDxn6ERuG5BjQ@mail.gmail.com> (raw)
In-Reply-To: <CAHYJk3QvTvjtvQFRfbn+r9S3f4mBC6Pfef6exG4HSE5BrU9EHg@mail.gmail.com>

On Sat, Jan 2, 2021 at 10:41 AM Mikael Magnusson <mikachu@gmail.com> 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


  reply	other threads:[~2021-01-02 18:30 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-31  5:41 [PATCH 0/3] Build fixes Felipe Contreras
2020-12-31  5:41 ` [PATCH 1/3] src: fix build warnings Felipe Contreras
2021-01-02 11:22   ` Daniel Shahaf
2021-01-02 16:41     ` Mikael Magnusson
2021-01-02 18:30       ` Felipe Contreras [this message]
2021-01-04  5:14         ` Daniel Shahaf
2021-03-27 19:28           ` Lawrence Velázquez
2021-04-04  6:38             ` Jun. T
2020-12-31  5:41 ` [PATCH 2/3] autoconf: remove deprecated functions Felipe Contreras
2021-03-27 19:37   ` Lawrence Velázquez
2021-04-03 15:04     ` Lawrence Velázquez
2020-12-31  5:41 ` [PATCH 3/3] autoconf: prepare for 2.70 Felipe Contreras
2021-03-27 19:38   ` Lawrence Velázquez
2021-04-03 15:44     ` Lawrence Velázquez
2021-04-08 22:44       ` Oliver Kiddle
2021-04-09  4:18         ` Jun T
2021-04-09 20:08           ` Oliver Kiddle
2021-04-09 20:28             ` Peter Stephenson
2021-04-09 23:04               ` Bart Schaefer
2021-04-09 23:19                 ` Mikael Magnusson
2021-04-10  0:37                 ` Jun. T

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMP44s05KAVSWP90NeZ5DnUOSTkKF4eEmFJqHCDxn6ERuG5BjQ@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=d.s@daniel.shahaf.name \
    --cc=mikachu@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).