From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E2C4C3858D3C; Wed, 24 May 2023 21:55:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E2C4C3858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684965337; bh=Vy44YpX7HyuiMc/5A2nGfXdpHOJpw3Xc8yDiruqg42U=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VCKNYXZf6wWvoCAClW9hVJtmwAplgnwd75ve8vouueXp5TutOYEl2Xcve09SxwPEt qcnfqAfqYkdtPCy72Ho55/PsmK//FYcU0OKEAc54tDPV4uzZROHpije74oYx8NA4eL dvbhbZXP1KFIo+00Rp4tAbwa0kFRJ6NGjyU6IBGc= From: "joseph at codesourcery dot com" 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 21:55:37 +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: joseph at codesourcery dot com 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: 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 --- Comment #7 from joseph at codesourcery dot com --- I suppose the question is how to interpret "the longest array (with the=20 same element type) that would not make the structure larger than the=20 object being accessed". The difficulty of interpreting "make the=20 structure larger" in terms of including post-array padding in the=20 replacement structure is that there might not be a definition of what that= =20 post-array padding should be given the offset of the array need not be the= =20 same as the offset with literal replacement in the struct definition.=