From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C17AD385DC2E; Fri, 8 Mar 2024 20:42:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C17AD385DC2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1709930546; bh=04BzhJhwN9KgCy8ZrW8Z7mWwE5S8Ck8aLQbaF5CzZ1k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GB71qHBAdJ4CbZliF9TpqpXLAG+AZ8pbKg2yrknV2zzV25Ul1owcfxnZxNy92WDFH xnG+t/rJRLnwkeshV7mMENURpyZzKmjRkALvaXLkLkQxKx1zEYcaleBUFJ86/hkRBN YSM4L6W1g11BvSHfL0ezxgQcrhUnuPwR2VAiui88= From: "kees at outflux dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53548] allow flexible array members in unions like zero-length arrays Date: Fri, 08 Mar 2024 20:42:26 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: kees at outflux dot net X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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=3D53548 --- Comment #7 from Kees Cook --- There is still no way to use C99 flexible arrays in unions (or alone in structs) without syntactic obfuscation. The extension that already allows 0-sized arrays in unions should be extended to cover C99 arrays. This is especially important for projects migrating away from the various deprecated "fake" flexible array members to C99 flex array members, as they continue to depend on both union membership and single-member structs (i.e. the Linux kernel has lots of these, some even in UAPI). Please reopen this bug. :) Clang is also preparing to fix this issue.=