public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bruno at clisp dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/52023] _Alignof (double) yields wrong value on x86
Date: Fri, 27 Jan 2012 23:12:00 -0000	[thread overview]
Message-ID: <bug-52023-4-1969pjTsOK@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52023-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023

--- Comment #9 from bruno at clisp dot org 2012-01-27 22:39:01 UTC ---
(In reply to comment #7)
> What happens if you have the attribute packed on the structure?

Attribute 'packed' is outside the scope of ISO C11. We're discussing ISO C11
compliant programs here.

ISO C11 has the _Alignas keyword, with which a stricter alignment can be
requested (ISO C11 6.2.8.(1), 6.7.5.(4)), but not a less strict alignment.

GCC's __alignof__ that returns the *preferred* alignment of an object of the
given type has its uses (in memory allocators for example). But the semantics
imposed by ISO C11 on the 'alignof' and '_Alignof' operators defined through
<stdalign.h> is address boundary requirement for all "objects" of that type,
not the preferred alignment.


  parent reply	other threads:[~2012-01-27 22:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 20:06 [Bug c/52023] New: " eggert at gnu dot org
2012-01-27 20:12 ` [Bug target/52023] " pinskia at gcc dot gnu.org
2012-01-27 21:10 ` bruno at clisp dot org
2012-01-27 21:39 ` pinskia at gcc dot gnu.org
2012-01-27 21:43 ` pinskia at gcc dot gnu.org
2012-01-27 21:44 ` pinskia at gcc dot gnu.org
2012-01-27 21:54 ` eggert at gnu dot org
2012-01-27 21:54 ` pinskia at gcc dot gnu.org
2012-01-27 22:39 ` eggert at gnu dot org
2012-01-27 23:12 ` bruno at clisp dot org [this message]
2012-01-27 23:30 ` joseph at codesourcery dot com
2012-01-27 23:37 ` joseph at codesourcery dot com
2012-01-30 11:15 ` [Bug c/52023] [C11] " rguenth at gcc dot gnu.org
2013-12-04 22:57 ` jsm28 at gcc dot gnu.org
2013-12-04 22:59 ` jsm28 at gcc dot gnu.org
2013-12-04 23:00 ` jsm28 at gcc dot gnu.org
2013-12-05  9:56 ` jbglaw@lug-owl.de
2013-12-05 12:08 ` mpolacek at gcc dot gnu.org
2014-01-14 10:31 ` jbglaw@lug-owl.de
2014-01-14 11:50 ` jakub at gcc dot gnu.org

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=bug-52023-4-1969pjTsOK@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).