From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9528 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: RE: [PATCH] MIPS64 atomic_arch.h Clang complains about input type Date: Tue, 8 Mar 2016 12:26:13 +0100 Message-ID: <20160308112613.GX29662@port70.net> References: 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 1457436408 1620 80.91.229.3 (8 Mar 2016 11:26:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Mar 2016 11:26:48 +0000 (UTC) Cc: "Rich Felker (dalias@libc.org)" To: musl@lists.openwall.com Original-X-From: musl-return-9541-gllmg-musl=m.gmane.org@lists.openwall.com Tue Mar 08 12:26:30 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1adFmW-00029C-RQ for gllmg-musl@m.gmane.org; Tue, 08 Mar 2016 12:26:28 +0100 Original-Received: (qmail 12080 invoked by uid 550); 8 Mar 2016 11:26:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 12054 invoked from network); 8 Mar 2016 11:26:25 -0000 Mail-Followup-To: musl@lists.openwall.com, "Rich Felker (dalias@libc.org)" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9528 Archived-At: * Jaydeep Patil [2016-03-08 10:09:43 +0000]: > > ./arch/mips64/atomic_arch.h:37:29: error: unsupported inline asm: input with type 'long *' matching output with type 'int' > clang probably should not complain about this (it's possible to have the output in the low 32bit of a 64bit input reg and then you do want mismatching input/output types for the same reg) > #define a_sc_p a_sc_p > -static inline int a_sc_p(volatile long *p, void *v) > +static inline void *a_sc_p(volatile long *p, void *v) > { > - int r; > + void *r; > __asm__ __volatile__ ( > "scd %0, %1" > : "=r"(r), "=m"(*p) : "0"(v) : "memory"); the return type should be int (1 on success, 0 on failure) e.g. you can use 'long r' instead of 'int r' if clang still complains then maybe union {void *v; long r;} u = {v}; __asm__ __volatile__ ( "scd %0, %1" : "+r"(u.v), "=m"(*p) :: "memory"); return u.r;