From patchwork Sun Nov 9 21:53:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123843 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C166E3858402 for ; Sun, 9 Nov 2025 22:00:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C166E3858402 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=DnXWUEy8 X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by sourceware.org (Postfix) with ESMTPS id B432D3858405 for ; Sun, 9 Nov 2025 21:53:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B432D3858405 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B432D3858405 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.234.252.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725188; cv=none; b=dW3oj49mIXQSNdmqj1bPohS9LXuriS3T92TOFYxeozAe1bZ7O6/9d9YsJ4L9XkyvI32SVKuQN9BsiOaaMvI4vMrsgWiFrmXrtk4Q791cRHuSam+5MbRhzAZLB/uXfnLp+x/GIt5n9W1K6eZ4RnRviS1ncSyvqK7Pc1tINg3Q3GM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725188; c=relaxed/simple; bh=i+9j8UXSuP+x3shrfya/v/FeqVn5ByFfXOy/HHSIBbg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=pTfbaEht8GxHC1AY6HNXIA967frxamXvR2HE7W4adPZ2x9ThihH5ozurgoHm4fkZ8Bjf2SA/eYFDfe9ABH1xMTsth4UpuoUvD2sU26MATjGUt648f4laZKNH7ZOV5Eq62El/VYIzmOwwc4f20I5Ys/BgR27e9r+B/plohLEuBdk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B432D3858405 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 28614444AE for ; Sun, 9 Nov 2025 21:53:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59AC4C4CEF7; Sun, 9 Nov 2025 21:53:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725188; bh=i+9j8UXSuP+x3shrfya/v/FeqVn5ByFfXOy/HHSIBbg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DnXWUEy8dGBlj3hgCltBCTFtQoJssil2Ef2QBITi3AjFtB3M1jgfSciXORn9deJ2Q X3GVl4tpVL9BszxcU/Du7YgwfpppHfbZWwi4n3ozO26yxF96SP8tCjfRq6j7hreYb+ KiJ4uKRmkUUnIxlYPPJNKzLC2NtpdFQ1LXE07vk7GlIEUX2vTy01JFRCsGZ21gyIof /FDpaeH4QLV0z44zhhyGGBcrR4HCcC3enYN6oPkOGyfyDzNZOKaus2PlDiIShuYbS+ nnrnp3dj1/bmjLCdOQPB57VHZJeYpqwzH+NQ2l/ZNXy3OfXHYjo1FwDAtpiJ811xz/ kmET5BTdJOHtA== Date: Sun, 9 Nov 2025 22:53:05 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 08/35] Remove __flexarr macro Message-ID: X-Mailer: git-send-email 2.51.0 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces~patchwork=sourceware.org@sourceware.org It's unconditionally defined as []. Signed-off-by: Alejandro Colomar --- bits/socket.h | 2 +- locale/localeinfo.h | 2 +- misc/sys/cdefs.h | 2 -- sysdeps/generic/unwind-dw2-fde.h | 6 +++--- sysdeps/mach/hurd/bits/socket.h | 2 +- sysdeps/unix/sysv/linux/bits/socket.h | 2 +- sysdeps/unix/sysv/linux/sys/inotify.h | 2 +- 7 files changed, 8 insertions(+), 10 deletions(-) diff --git a/bits/socket.h b/bits/socket.h index e83ad5bc01..41910dbe65 100644 --- a/bits/socket.h +++ b/bits/socket.h @@ -222,7 +222,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ /* This field is to be aligned with CMSG_ALIGN */ - /* __extension__ unsigned char __cmsg_data __flexarr; */ /* Ancillary data. */ + /* __extension__ unsigned char __cmsg_data[]; */ /* Ancillary data. */ }; /* Ancillary data object manipulation macros. */ diff --git a/locale/localeinfo.h b/locale/localeinfo.h index f503792d04..6f225c3647 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -79,7 +79,7 @@ struct __locale_data const char *string; unsigned int word; /* Note endian issues vs 64-bit pointers. */ } - values __flexarr; /* Items, usually pointers into `filedata'. */ + values[]; /* Items, usually pointers into `filedata'. */ }; /* This alignment is used for 32-bit integers in locale files, both diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h index 6a680adcde..87c3581bb7 100644 --- a/misc/sys/cdefs.h +++ b/misc/sys/cdefs.h @@ -357,12 +357,10 @@ (e.g. only if they won't affect sizeof()) should test #if __glibc_c99_flexarr_available. */ #if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc -# define __flexarr [] # define __glibc_c99_flexarr_available 1 #else /* GCC and clang support C99 flexible array members as an extension, even when in C89 mode or compiling C++ (any version). */ -# define __flexarr [] # define __glibc_c99_flexarr_available 1 #endif diff --git a/sysdeps/generic/unwind-dw2-fde.h b/sysdeps/generic/unwind-dw2-fde.h index 37a5ad3480..8972af47c2 100644 --- a/sysdeps/generic/unwind-dw2-fde.h +++ b/sysdeps/generic/unwind-dw2-fde.h @@ -22,7 +22,7 @@ struct fde_vector { void *orig_data; size_t count; - struct dwarf_fde *array __flexarr; + struct dwarf_fde *array[]; }; #ifdef _LIBC @@ -128,7 +128,7 @@ struct dwarf_cie uword length; sword CIE_id; ubyte version; - unsigned char augmentation __flexarr; + unsigned char augmentation[]; } __attribute__ ((packed, aligned (__alignof__ (void *)))); /* The first few fields of an FDE. */ @@ -136,7 +136,7 @@ struct dwarf_fde { uword length; sword CIE_delta; - unsigned char pc_begin __flexarr; + unsigned char pc_begin[]; } __attribute__ ((packed, aligned (__alignof__ (void *)))); typedef struct dwarf_fde fde; diff --git a/sysdeps/mach/hurd/bits/socket.h b/sysdeps/mach/hurd/bits/socket.h index 8c18cef579..9b51c5c431 100644 --- a/sysdeps/mach/hurd/bits/socket.h +++ b/sysdeps/mach/hurd/bits/socket.h @@ -229,7 +229,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ /* This field is to be aligned with CMSG_ALIGN */ - /* __extension__ unsigned char __cmsg_data __flexarr; */ /* Ancillary data. */ + /* __extension__ unsigned char __cmsg_data[]; */ /* Ancillary data. */ }; /* Ancillary data object manipulation macros. */ diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h index f6eb297998..ac22e11c4d 100644 --- a/sysdeps/unix/sysv/linux/bits/socket.h +++ b/sysdeps/unix/sysv/linux/bits/socket.h @@ -290,7 +290,7 @@ struct cmsghdr int cmsg_level; /* Originating protocol. */ int cmsg_type; /* Protocol specific type. */ #if __glibc_c99_flexarr_available - __extension__ unsigned char __cmsg_data __flexarr; /* Ancillary data. */ + __extension__ unsigned char __cmsg_data[]; /* Ancillary data. */ #endif }; diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h index 8b234229be..8b8a7c4694 100644 --- a/sysdeps/unix/sysv/linux/sys/inotify.h +++ b/sysdeps/unix/sysv/linux/sys/inotify.h @@ -31,7 +31,7 @@ struct inotify_event uint32_t mask; /* Watch mask. */ uint32_t cookie; /* Cookie to synchronize two events. */ uint32_t len; /* Length (including NULs) of name. */ - char name __flexarr; /* Name. */ + char name[]; /* Name. */ };