Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH 2/2] Fix two C nits
- X-seq: zsh-workers 43053
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH 2/2] Fix two C nits
- Date: Mon, 18 Jun 2018 10:22:41 +0100
- Cms-type: 201P
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180618092244euoutp02c5ef0dd4a8f8e42a15443e2636bb3cfb~5NsQ8jxQv1792917929euoutp02c
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1529313764; bh=yuWrKWbCizeY4/wcawVhqqVLL1EEzXNY6wLHPdPL7cg=; h=Date:From:To:Subject:In-Reply-To:References:From; b=XrDonRRX85tykcaid54k4VSU/wcrJOT51Lbe20Q+1gk64mGNlEYZRjronr+F3PxAX j41o7m5s+axQZ2pbReOLjqv58texya8sPoyrO0bCqmo5qiCDaBHmO4Hbb5zfHH+g6f USRG2YcFl0M37crG42e0U9Duis1nlEhUKiYx3AAY=
- In-reply-to: <20180616010427.2916-2-lists@eitanadler.com>
- 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>
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;
> }
I'm not 100% sure about this since you're relying on the compiler
knowing that _exit won't return. Probably the majority of compilers
we're involved with for zsh will work that out, but I'm not sure
it's actually required by the C standard that they know the function
doesn't return, is it? You may know some corner I haven't investigated.
I'd have been tempted to add /*NOTREACHED*/ on the next line.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author