From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2610:1c1:1:606c::19:2]) by sourceware.org (Postfix) with ESMTPS id 1FB253857C67 for ; Sat, 5 Jun 2021 21:20:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1FB253857C67 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id F10DD831F7; Sat, 5 Jun 2021 21:20:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FyCGF69fWz4Qm2; Sat, 5 Jun 2021 21:20:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (c-98-35-218-221.hsd1.ca.comcast.net [98.35.218.221]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 7970DB607; Sat, 5 Jun 2021 21:20:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: [PATCH 1/2] nat/amd64-linux-siginfo.c: Move align attribute from typedef to struct To: Pedro Alves , gdb-patches@sourceware.org References: <20210605001427.3597687-1-pedro@palves.net> <20210605001427.3597687-2-pedro@palves.net> From: John Baldwin Message-ID: <31bde046-a86f-9995-545d-a03737cf493b@FreeBSD.org> Date: Sat, 5 Jun 2021 14:20:17 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: <20210605001427.3597687-2-pedro@palves.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Jun 2021 21:20:26 -0000 On 6/4/21 5:14 PM, Pedro Alves wrote: > diff --git a/gdb/nat/amd64-linux-siginfo.c b/gdb/nat/amd64-linux-siginfo.c > index e2d2db6e112..9ff9361487a 100644 > --- a/gdb/nat/amd64-linux-siginfo.c > +++ b/gdb/nat/amd64-linux-siginfo.c > @@ -206,7 +206,7 @@ typedef struct compat_siginfo > /* For x32, clock_t in _sigchld is 64bit aligned at 4 bytes. */ > typedef long __attribute__ ((__aligned__ (4))) compat_x32_clock_t; > > -typedef struct compat_x32_siginfo > +typedef struct __attribute__ ((__aligned__ (8))) compat_x32_siginfo > { > int si_signo; > int si_errno; > @@ -263,7 +263,7 @@ typedef struct compat_x32_siginfo > int _fd; > } _sigpoll; > } _sifields; > -} compat_x32_siginfo_t __attribute__ ((__aligned__ (8))); > +} compat_x32_siginfo_t; > > /* To simplify usage of siginfo fields. */ Looks good to me. Note that alignas() is part of C++11, so you could perhaps spell this a bit shorter as "alignas (8)" instead. -- John Baldwin