From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4966 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 3/3] stddef: Define max_align_t Date: Sun, 27 Apr 2014 22:03:28 -0400 Message-ID: <20140428020328.GV26358@brightrain.aerifal.cx> References: <1398649434-23560-1-git-send-email-raj.khem@gmail.com> <1398649434-23560-3-git-send-email-raj.khem@gmail.com> 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 1398650661 13689 80.91.229.3 (28 Apr 2014 02:04:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 02:04:21 +0000 (UTC) Cc: Khem Raj To: musl@lists.openwall.com Original-X-From: musl-return-4970-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 28 04:04:15 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 1WeavV-0002xv-0u for gllmg-musl@plane.gmane.org; Mon, 28 Apr 2014 04:04:13 +0200 Original-Received: (qmail 17976 invoked by uid 550); 28 Apr 2014 02:04:12 -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 17739 invoked from network); 28 Apr 2014 02:03:40 -0000 Content-Disposition: inline In-Reply-To: <1398649434-23560-3-git-send-email-raj.khem@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:4966 Archived-At: On Sun, Apr 27, 2014 at 06:43:54PM -0700, Khem Raj wrote: > c++11 defines is and libstdc++ from gcc 4.9 now needs it Is it also in C11 or just C++11? If it's not in C11 it needs to be namespace protected. > Signed-off-by: Khem Raj > > Upstream-Status: Pending > --- > include/stddef.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/stddef.h b/include/stddef.h > index 0a32919..788227a 100644 > --- a/include/stddef.h > +++ b/include/stddef.h > @@ -19,4 +19,9 @@ > #define offsetof(type, member) ((size_t)( (char *)&(((type *)0)->member) - (char *)0 )) > #endif > > +typedef struct { > + long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); > + long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); > +} max_align_t; > + As far as I can tell, there's no reason to use the attribute here. What's it there for? Also a union would probably be nicer than a struct, but perhaps it doesn't matter. Rich