From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-out.m-online.net (mail-out.m-online.net [IPv6:2001:a60:0:28:0:1:25:1]) by sourceware.org (Postfix) with ESMTPS id 08D64385780A for ; Mon, 16 Nov 2020 21:40:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 08D64385780A Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=whitebox@nefkom.net Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CZjDb62Yqz1rwDr; Mon, 16 Nov 2020 22:40:47 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CZjDb4xbHz1rYF9; Mon, 16 Nov 2020 22:40:47 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id hmsgaXA7p7jh; Mon, 16 Nov 2020 22:40:46 +0100 (CET) X-Auth-Info: ksCt0IZjwSnaf1iGsPOEJTOPxOldruaNV87Y2L+IPqcwxvMO0TgL0pESWhpG2Fds Received: from igel.home (ppp-46-244-169-244.dynamic.mnet-online.de [46.244.169.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Mon, 16 Nov 2020 22:40:46 +0100 (CET) Received: by igel.home (Postfix, from userid 1000) id 2922E2C3398; Mon, 16 Nov 2020 22:40:46 +0100 (CET) From: Andreas Schwab To: Adhemerval Zanella via Libc-alpha Subject: Re: [PATCH] linux: mips: Fix getdents64 fallback on mips64-n32 References: <20201116211743.2228063-1-adhemerval.zanella@linaro.org> X-Yow: Now I'm having INSIPID THOUGHTS about the beautiful, round wives of HOLLYWOOD MOVIE MOGULS encased in PLEXIGLASS CARS and being approached by SMALL BOYS selling FRUIT.. Date: Mon, 16 Nov 2020 22:40:46 +0100 In-Reply-To: <20201116211743.2228063-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella via Libc-alpha's message of "Mon, 16 Nov 2020 18:17:43 -0300") Message-ID: <875z659e01.fsf@igel.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Nov 2020 21:40:50 -0000 On Nov 16 2020, Adhemerval Zanella via Libc-alpha wrote: > diff --git a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c > index d18a5297dc..5b7597c99b 100644 > --- a/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c > +++ b/sysdeps/unix/sysv/linux/mips/mips64/getdents64.c > @@ -91,15 +91,18 @@ __getdents64 (int fd, void *buf, size_t nbytes) > while ((char *) kdp < (char *) skdp + r) > { > /* This macro is used to avoid aliasing violation. */ > -#define KDP_MEMBER(src, member) \ > - (__typeof__((struct kernel_dirent){0}.member) *) \ > - memcpy (&((__typeof__((struct kernel_dirent){0}.member)){0}), \ > - ((char *)(src) + offsetof (struct kernel_dirent, member)),\ > - sizeof ((struct kernel_dirent){0}.member)) > +#define KDP_MEMBER(member) \ > + ({ \ > + __typeof ((struct kernel_dirent){0}.member) kdp_tmp; \ > + memcpy (&kdp_tmp, \ > + ((char *)(kdp) + offsetof (struct kernel_dirent, member)), \ > + sizeof (kdp_tmp)); \ > + kdp_tmp; \ > + }) Why can't this just be kdp->member? Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1 "And now for something completely different."