From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5048 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Pawe=C5=82_Dziepak?= Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] add definition of max_align_t to stddef.h Date: Sun, 4 May 2014 13:42:05 +0200 Message-ID: References: <1398889381-22981-1-git-send-email-pdziepak@quarnos.org> <20140430214250.GI12324@port70.net> <20140430224311.GP26358@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 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1399203750 28363 80.91.229.3 (4 May 2014 11:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 4 May 2014 11:42:30 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-5052-gllmg-musl=m.gmane.org@lists.openwall.com Sun May 04 13:42:25 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 1WguoF-0002tm-2b for gllmg-musl@plane.gmane.org; Sun, 04 May 2014 13:42:19 +0200 Original-Received: (qmail 5395 invoked by uid 550); 4 May 2014 11:42:18 -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 5387 invoked from network); 4 May 2014 11:42:18 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=g/BFZ1GeoYAUY0oZLu2tNOsdWb3qeQjHx8HuONAjqAg=; b=OVIvXrsqLh3hxaVq7c86ppiPzqybI3O+fzTgcLoP/2EmaNJnfk9t/iJyDjZgy7i5Ci UZY1DirF6jjZU2BLGKsYC8kyXLpIRnBEVjifS6Rrf++TerhW01hfeJHqoL5rEe/ROTJM seQABPn7Vk5KiARE4a9agSCZKFQRQG7tdK5yOUIWzBnWNAIMed/7JKN7i942YFDWd+gk PMq0YdWZBwvS1aSiPJqpZG1Zt2walvINp71YhdqOJn+CM2DvKGjY4rkJQsWwQqQp8JS5 lgV4g0hRU5dpS3IbvMeWCAKrWhdR9oKMjtTxrWQFwLhswhXMjmzUv0g5AVxuNgH/bVJc QccQ== X-Gm-Message-State: ALoCoQmpDk9UZzzJLBvNklK0kQXWvJXotbHSfyapXoRixi/C/zJa1a1wMDxtS8q6cWIBPHQKKKma X-Received: by 10.50.57.109 with SMTP id h13mr16674711igq.3.1399203725769; Sun, 04 May 2014 04:42:05 -0700 (PDT) In-Reply-To: <20140430224311.GP26358@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:5048 Archived-At: 2014-05-01 0:43 GMT+02:00 Rich Felker : > On Wed, Apr 30, 2014 at 11:42:51PM +0200, Szabolcs Nagy wrote: >> * Pawel Dziepak [2014-04-30 22:23:01 +0200]: >> > >> > +TYPEDEF union { long double ld; long long ll; } max_align_t; >> >> this is wrong >> >> - ld and ll identifiers are not reserved for the implementation >> (you could name them _ld, _ll or __ld, __ll etc) > > It's also not clear to me why this should go in alltypes.h. Unless it > needs to be arch-specific, it could go directly in stddef.h. > >> and see previous max_align_t discussion >> http://www.openwall.com/lists/musl/2014/04/28/8 >> >> - compiler implementations are non-conforming on some platforms >> (_Alignof returns inconsistent results for the same object type so >> reasoning about alignments is problematic, there are exceptions >> where this is allowed in c++11 but not in c11) > > Is there a bug filed against gcc yet? The behavior in GCC 4.9 has changed. _Alignof(long long) now is always 4. _Alignof(max_align_t) remains 8 though. Because of this, the solution I proposed in earlier post doesn't work anymore (_Alignof(max_align_t) would be 4 if GCC 4.9 didn't complain that _Alignas(long long) reduces alignment of long long which is weird but probably doesn't matters much in this discussion) and I looks like the only option is to use __attribute__((__aligned__(...))). I don't think there is reason for me to send another version of this patch since there has already been sent a patch which defines max_align_t in such way. Pawe=C5=82