From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa2e.google.com (mail-vk1-xa2e.google.com [IPv6:2607:f8b0:4864:20::a2e]) by sourceware.org (Postfix) with ESMTPS id 5B5D33858C52 for ; Sat, 8 Jul 2023 19:21:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B5D33858C52 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=rodriguez.im Authentication-Results: sourceware.org; spf=none smtp.mailfrom=cristianrodriguez.net Received: by mail-vk1-xa2e.google.com with SMTP id 71dfb90a1353d-47dccf6307aso198411e0c.1 for ; Sat, 08 Jul 2023 12:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rodriguez.im; s=google; t=1688844078; x=1691436078; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=lch7FLp61nKQCROK5krqACdp7pMCjZE4rGKF1xIrjko=; b=dALZuhTq1Q5g1q/GGDCgM1amY8TsBjIv5/eYPmPGjs6i5XUuF4QRa/rN9SBr2KIN/G 0IXPKM9Z5fOjYxq9J46NI5nM8lNHy28WzsW+JBGSp4cz6fABNQerRXrYld69nDeSb6mj cl8UBJGndd2Ww6I1dqF1m80Kp/D5/w89aZI3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688844078; x=1691436078; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=lch7FLp61nKQCROK5krqACdp7pMCjZE4rGKF1xIrjko=; b=Q8aJdrMMrToAoP1EwR1LnoQavhP30gtvulcY9V2+mjhw3kYyNVt7TQ36EmA2euYpPb aGx3+62+w+oUVVWkTYHmvgQhnGm0KbERdUw88Co/s2mBu2kQOe4UuNb1YyxOp8T/z54n 7FAieon6c907Aoh9QVWRmpyk3AXigkOqlWUSfyC8DO2BiUMHtkyczft1otTuGxIo2zxc XpxZ6JVTq2SQBmo7mUeIlhMO8IqF0nKtNAeDLaee8zj9ThnhPzmcNH655CwYCWnHHaaf Bgjd+UQ4A+3XbjmtqnBf/723DU0zRElFhxZxkNpkWrRMXNEk8u5Bx54bdBDpOhCfgFKm E6Gw== X-Gm-Message-State: ABy/qLaOSGvFVdBvJT8agpGdFKjfqws1qgOC8mGh9A6alFkdm8BCRf/T DcXWtfUaYC2x9R9UNNl4EHgKGdZCR4G3xh2sD9Fqa9+pnpmEA7eT X-Google-Smtp-Source: APBJJlHx5hgjPMj1btvVwFJGKdn0CreoBDxmTe1KfhEAKHEZlYf05q/UOZfR53j/umbugwoXQCgV21jlHanTMNBaE24= X-Received: by 2002:a05:6102:e07:b0:443:e4a4:c2c3 with SMTP id o7-20020a0561020e0700b00443e4a4c2c3mr4042347vst.2.1688844078526; Sat, 08 Jul 2023 12:21:18 -0700 (PDT) MIME-Version: 1.0 References: <72030a27-e222-6835-7be1-e34f07b46d0e@cs.ucla.edu> In-Reply-To: From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Sat, 8 Jul 2023 15:21:07 -0400 Message-ID: Subject: Re: gcc-14 Wflex-array-member-not-at-end may-be-ub in struct pthread To: Paul Eggert , "Carlos O'Donell" Cc: Adhemerval Zanella via Libc-alpha Content-Type: multipart/alternative; boundary="00000000000061c66a05fffea789" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000061c66a05fffea789 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jul 5, 2023 at 2:13=E2=80=AFPM Cristian Rodr=C3=ADguez wrote: > > > On Wed, Jul 5, 2023 at 11:53=E2=80=AFAM Paul Eggert = wrote: > >> On 2023-07-05 06:46, Cristian Rodr=C3=ADguez via Libc-alpha wrote: >> > char end_padding[]; --> This is incorrect, since struct rseq >> contains a >> > flexible array it must be the last member.. >> >> ? struct rseq doesn't contain a flexible array on the master branch, so >> there's no error here. >> > > I may be missing something but I have struct rseq containing a final > flexible array.. > > /* > * Flexible array member at end of structure, after last feature > field. > */ > char end[]; > } > > this happens because: > > #ifdef __has_include > # if __has_include ("linux/rseq.h") > # define __GLIBC_HAVE_KERNEL_RSEQ --> that is defined > # endif > > >> Perhaps you tried to nest 'struct pthread' inside another struct? If so, >> the C standard doesn't allow that but the attached untested patch should >> be a trivial fix. >> > > Your patch does indeed silence this particular warning, thanks. > I suggest you add this patch to the release queue. because as far as I can tell, It is UB when the kernel headers are present on the system. --00000000000061c66a05fffea789--