From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4969 Path: news.gmane.org!not-for-mail From: Khem Raj Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 3/3] stddef: Define max_align_t Date: Sun, 27 Apr 2014 22:51:34 -0700 Message-ID: References: <1398649434-23560-1-git-send-email-raj.khem@gmail.com> <1398649434-23560-3-git-send-email-raj.khem@gmail.com> <20140428020328.GV26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1398664344 9588 80.91.229.3 (28 Apr 2014 05:52:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 28 Apr 2014 05:52:24 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-4973-gllmg-musl=m.gmane.org@lists.openwall.com Mon Apr 28 07:52:19 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 1WeeUD-0007Ym-8L for gllmg-musl@plane.gmane.org; Mon, 28 Apr 2014 07:52:17 +0200 Original-Received: (qmail 16109 invoked by uid 550); 28 Apr 2014 05:52:16 -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 16101 invoked from network); 28 Apr 2014 05:52:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=SAGxLYiOj5RFaBmpLts+vJlttyPEJrV+7p7C+StexVo=; b=ZCywrMwDUkkAFb3cYSA0SZQtnu8uBT5MxKsfuJO4eyLlXspLbg89tFxNYAiRCr+Em1 tMdlDL4uINOqv/X1lplxSAuZT89ICusUTTU08TUHDf7bMaFYUEOtZd8RYVP3G8Owv5HE ks4LLWSvz9dsZ8/r+s/bLB9vsUC59M06NTvEFPWVRMv0MmvZEaqshnoTIzQX/AlBZ99u g8nhUGxLIMytI7KTyRRr+5GYmAv6+87X1S32684yGTRmme03YQY/RwNAWEV92Kr2ywPf 2CFnZJcJ62LTB4dGzqm8iq55r+IXgR8RppVBDs+AdmsCanhCzGtSWclsDP1KLpLEZpKT vcKQ== X-Received: by 10.42.206.9 with SMTP id fs9mr21360797icb.33.1398664324176; Sun, 27 Apr 2014 22:52:04 -0700 (PDT) In-Reply-To: <20140428020328.GV26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:4969 Archived-At: On Sun, Apr 27, 2014 at 7:03 PM, Rich Felker wrote: > 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. yes its for both so may something like #if __STDC_VERSION__ >= 201112L || __cplusplus >= 201103L > >> 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. union does not return correct alignment where as struct did. I just tried to match what clang also has http://reviews.llvm.org/rL201729 > > Rich