Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/2] Fix two C nits
- X-seq: zsh-workers 43066
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH 2/2] Fix two C nits
- Date: Tue, 19 Jun 2018 15:13:19 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20180619141323euoutp01976be9da56d48e126f098e0304756ce3~5lTUYygVz1566715667euoutp01T
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1529417603; bh=NyUzFiu9T+onk2yL6/gAnlckhuNH4vrrBV7ciUqUuz0=; h=Date:From:To:Subject:In-Reply-To:References:From; b=srUrZz5EgC0J9ke2EbqDIS7O7mjl6Q2wsbATe5jbxej1VCBbsUXU2g14m/bGhklH9 thEl6VHHwu3OiXMCJA2+lLzFxrBRUw/SOAUZ8vRnLsWianZlWTiTeKII0vL6IZ97xS DS+nkbJCzp34MMo8ONGlBAU+gK+/ZeW291rdnc1U=
- In-reply-to: <20180619134629.GA15318@zira.vinc17.org>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: SCSC
- References: <CGME20180616021439epcas4p327f4346b40d9e10d94ce055058fe0d71@epcas4p3.samsung.com> <20180616010427.2916-2-lists@eitanadler.com> <20180618092243eucas1p133cc109ed17712cd4253a72da472fa54~5NsPXgtMr0676306763eucas1p1g@eucas1p1.samsung.com> <20180619134629.GA15318@zira.vinc17.org>
On Tue, 19 Jun 2018 15:46:29 +0200
Vincent Lefevre <vincent@xxxxxxxxxx> wrote:
> On 2018-06-18 10:22:41 +0100, Peter Stephenson wrote:
> > On Sat, 16 Jun 2018 01:04:27 +0000
> > Eitan Adler <lists@xxxxxxxxxxxxxx> wrote:
> > > - avoid returning from a function that will never return
> > >
> > > diff --git a/Src/exec.c b/Src/exec.c
> > > index d44527841..b36bcef64 100644
> > > --- a/Src/exec.c
> > > +++ b/Src/exec.c
> > > @@ -4954,7 +4954,6 @@ getpipe(char *cmd, int nullexec)
> > > execode(prog, 0, 1, out ? "outsubst" : "insubst");
> > > cmdpop();
> > > _exit(lastval);
> > > - return 0;
> > > }
>
> The _exit function is non-standard.
That means from the basic C point of view it's not safe simply to remove
the return. We are not in the game of guessing what the compiler knows.
As the code's uambiguously correct as it is, and the compiler is
perfectly at liberty to optimise out the return if it knows the function
won't return, it can stay as it is.
Anything we *can* detect about the compiler / configuration is
fair game for improvement, however...
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author