From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/6009 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 7/8] add the thrd_xxxxxx functions Date: Sun, 31 Aug 2014 13:31:55 +0200 Message-ID: <20140831113154.GC27258@port70.net> References: <22215ff2f880382340930f78cc746565a625a806.1409423162.git.Jens.Gustedt@inria.fr> <20140831004643.GP12888@brightrain.aerifal.cx> <1409471854.4476.272.camel@eris.loria.fr> <1409482237.4476.277.camel@eris.loria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1409484736 29810 80.91.229.3 (31 Aug 2014 11:32:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 31 Aug 2014 11:32:16 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-6016-gllmg-musl=m.gmane.org@lists.openwall.com Sun Aug 31 13:32:09 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1XO3Mf-0007hB-BR for gllmg-musl@plane.gmane.org; Sun, 31 Aug 2014 13:32:09 +0200 Original-Received: (qmail 32194 invoked by uid 550); 31 Aug 2014 11:32:07 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32182 invoked from network); 31 Aug 2014 11:32:07 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:6009 Archived-At: * Alexander Monakov [2014-08-31 15:06:02 +0400]: > On Sun, 31 Aug 2014, Jens Gustedt wrote: > > > > echo 'int g(void*); int a; int b; int f(int y){ if (y) return g(&a); else return g(&b);} int h(int y) { return y ? g(&a) : g(&b); }' | gcc -xc - -S -o- -O > > No, your h() is not what is intended. It should be '{return g{y ? &a : &b);}', > and it does make a difference. > even with no code gen difference i find r = f(c?x:y, u, v, w); cleaner than if (c) r = f(x, u, v, w); else r = f(y, u, v, w); because the first one makes it clear that only one arg is changed based on c, the rest of the logic is the same (maybe the c?x:y should be done on a separate line if the call becomes too long)