From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17261 invoked by alias); 23 Aug 2015 13:49:21 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 17249 invoked by uid 89); 23 Aug 2015 13:49:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f174.google.com Received: from mail-yk0-f174.google.com (HELO mail-yk0-f174.google.com) (209.85.160.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 23 Aug 2015 13:49:20 +0000 Received: by ykfw73 with SMTP id w73so111713929ykf.3 for ; Sun, 23 Aug 2015 06:49:18 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.57.202 with SMTP id 193mr23616983ykz.118.1440337758004; Sun, 23 Aug 2015 06:49:18 -0700 (PDT) Received: by 10.37.214.136 with HTTP; Sun, 23 Aug 2015 06:49:17 -0700 (PDT) In-Reply-To: <20150823110539.GA16487@gate.crashing.org> References: <20150823110539.GA16487@gate.crashing.org> Date: Sun, 23 Aug 2015 13:49:00 -0000 Message-ID: Subject: Re: are statically allocated structs always aligned to a machine word on x86/x86_64? From: Jonathan Wakely To: Segher Boessenkool Cc: john smith , gcc-help Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00136.txt.bz2 On 23 August 2015 at 12:05, Segher Boessenkool wrote: > On Sun, Aug 23, 2015 at 12:15:56AM +0100, Jonathan Wakely wrote: >> because alignments must be a power of 2. > > That is true in C++, but not true in C or even POSIX afaics? C11 =C2=A76.2.8 "Every valid alignment value shall be a nonnegative integral power of two."