mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <jens.gustedt@inria.fr>
To: musl@lists.openwall.com
Subject: Re: [PATCH 3/3] stddef: Define max_align_t
Date: Mon, 28 Apr 2014 15:59:12 +0200	[thread overview]
Message-ID: <1398693552.7944.69.camel@eris.loria.fr> (raw)
In-Reply-To: <20140428132645.GH12324@port70.net>

[-- Attachment #1: Type: text/plain, Size: 1855 bytes --]

Am Montag, den 28.04.2014, 15:26 +0200 schrieb Szabolcs Nagy:
> no, long long (or any scalar type) cannot be an "over-aligned" type
> 
> "A type having an extended alignment requirement is an over-aligned type."
> "Every over-aligned type is, or contains, a structure or union type with
> a member to which an extended alignment has been applied."

The later is a footnote and so not normative, merely an explanation.

As a restrictive, normative text it makes not much sense to me anyhow.

> > I am not sure that I remember correctly, but it seems to me that i386
> > allows for 4 byte alignment of all types, only that this results in
> > suboptimal code
> 
> if long long has an alignment requirement of 4 byte then _Alignof should say so

I agree that this would certainly easier to cope with

(the compiler could still place them silently on 8 byte boundaries,
where it suits)

> > > 	typedef char max_align_t __attribute__((aligned(__BIGGEST_ALIGNMENT__)));
> > > 
> > > which gives 16 byte alignment on i386 gcc, i thought it was supported
> > > in all contexts
> > 
> > I think this just not necessary and even counter productive.
> 
> depends on what is the semantic meaning of max_align_t
> 
> currently it means "guaranteed to be supported in all contexts"

I think this isn't explicitly mentioned somewhere, but my expectation
is that the alignment of this type is the one that is guaranteed by
malloc and friends. That should be the only semantic to expect from
it.

Jens

-- 
:: INRIA Nancy Grand Est :: http://www.loria.fr/~gustedt/   ::
:: AlGorille ::::::::::::::: office Nancy : +33 383593090   ::
:: ICube :::::::::::::: office Strasbourg : +33 368854536   ::
:: ::::::::::::::::::::::::::: gsm France : +33 651400183   ::
:: :::::::::::::::::::: gsm international : +49 15737185122 ::



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2014-04-28 13:59 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  1:43 [PATCH 1/3] bits/socket.h: Define SO_RCVBUFFORCE for mips Khem Raj
2014-04-28  1:43 ` [PATCH 2/3] Add soname to dynamic section Khem Raj
2014-04-28  2:00   ` Rich Felker
2014-04-28  5:02     ` Khem Raj
2014-04-28  5:54       ` Isaac Dunham
2014-04-28  6:00         ` Khem Raj
2014-04-28  6:22           ` Isaac Dunham
2014-04-28  6:32             ` Timo Teras
2014-04-28  7:20             ` Khem Raj
2014-04-28 14:28               ` Rich Felker
2014-04-28  1:43 ` [PATCH 3/3] stddef: Define max_align_t Khem Raj
2014-04-28  2:03   ` Rich Felker
2014-04-28  5:51     ` Khem Raj
2014-04-28 10:11       ` Szabolcs Nagy
2014-04-28 12:22         ` Jens Gustedt
2014-04-28 13:26           ` Szabolcs Nagy
2014-04-28 13:59             ` Jens Gustedt [this message]
2014-04-28 14:14             ` Rich Felker
2014-04-28 14:29 ` [PATCH 1/3] bits/socket.h: Define SO_RCVBUFFORCE for mips Rich Felker
2014-04-28 14:54   ` Khem Raj
2014-04-30 18:48     ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1398693552.7944.69.camel@eris.loria.fr \
    --to=jens.gustedt@inria.fr \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).