From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE5DB3858D3C; Wed, 24 May 2023 16:28:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE5DB3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684945701; bh=rKAQFXKWVAohB/MeGjfLRGOQCGBMDmThLCQc1eSVWR0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lxH6lmvxDnr8GbTND/oflOxk4Tp00y6UcXHDEbspKCNDqfu0cUrqFLGOOJQz70FMA acy3DOAt2xk0Xzxx/8hhhMJZxiFk9modynaVGdhJWfTb5K3LIfQKJRe389GLlC77ly +XQH/0Nbp3Byg9Ib4Tt8lAVXJEfK4XL0Y6axz/Q4= From: "muecker at gwdg dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/109956] GCC reserves 9 bytes for struct s { int a; char b; char t[]; } x = {1, 2, 3}; Date: Wed, 24 May 2023 16:28:21 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: trivial X-Bugzilla-Who: muecker at gwdg dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109956 Martin Uecker changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |muecker at gwdg dot de --- Comment #2 from Martin Uecker --- To me it seems that the C standard requires that the object has=20 size sizeof(struct s) + n * sizeof(struct t) if you want to store n elements even when the array then starts at a smaller offset.=