From patchwork Sun Nov 9 21:53:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 123840 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 3ED163858C2C for ; Sun, 9 Nov 2025 21:58:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ED163858C2C 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=HebIwqMX X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by sourceware.org (Postfix) with ESMTPS id 0B513385840E for ; Sun, 9 Nov 2025 21:53:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0B513385840E 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 0B513385840E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725186; cv=none; b=gNkG4/0nnjV5RkGL30zhg2qieQwXnzkMgXfgBZzDuvROGamK8yigyYUgZsuHeO1haABvfLO06E1Lx1l1EaIClZYFdp3lHpkcKwC923mrB6ajdpolRDcUYSuz8sRf3OjP8C1yKRxHSldMh/41dJOSlYfx96Gp6+l3ToRN88HgnWI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1762725186; c=relaxed/simple; bh=kJJpIi+4HbBC+fXBnBZ8H7hAW+P9S9cXBTselSG2ZxA=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=NGJsBZbTjxztNLsnzjPvrJhvfAPSfryjj+tiAuHHX0PgWwfXlt8amOSdqfl9d8v7Qy5D8WNN+50qO7eXwJ4ki4ORlJIgD9n3CYeooJ4hWjCM7tbxrmsGaPgweBOEguKWe+KuvmNTYtyPImTMWGLREl24Qewj1uzc+z5dOjeqBW8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B513385840E Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id A9A1560008 for ; Sun, 9 Nov 2025 21:53:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AAAEAC4CEF7; Sun, 9 Nov 2025 21:53:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762725185; bh=kJJpIi+4HbBC+fXBnBZ8H7hAW+P9S9cXBTselSG2ZxA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HebIwqMXfs9KI1KVHhmWwWiUiXwASqGTPgK9DeqAakJYhLN/ID7joaS8beYXZ/xTC 6HJ7b8avOdqNeY4vFThYqb8arvDHs0hzvYo674uY3R91X20bp5W01GlzUFDgjJ5BvH RmughWe/SH29bA0SnEktl5Gp5IB/+gq4nrVlYMWXYwyhGQiS9AXJYubb07zHf3TpM1 vttv2GsyT6VnSh6WaTy1PGS3XuE3yBl5w7JvyewUe63dMfisEH3NoPLKzUJt1mBea+ NZ46KB2HzOSL+SD+gcggQFlsCdab1PRpUyzWsUmvQliyDdmkTYRgH2mzVzIOtN802+ s9C8sY5tM6OPA== Date: Sun, 9 Nov 2025 22:53:03 +0100 From: Alejandro Colomar To: libc-alpha@sourceware.org Cc: Alejandro Colomar Subject: [PATCH v1 07/35] intl/: Remove ZERO 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 We may want to use [], BTW, since GCC supports it since 2.97. Signed-off-by: Alejandro Colomar --- intl/dcigettext.c | 4 ++-- intl/gettextP.h | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/intl/dcigettext.c b/intl/dcigettext.c index fe5c19bf37..152ccfc94b 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -241,7 +241,7 @@ struct known_translation_t /* Pointer to the string in question. */ union { - char appended[ZERO]; /* used if domain != NULL */ + char appended[0]; /* used if domain != NULL */ const char *ptr; /* used if domain == NULL */ } msgid; @@ -362,7 +362,7 @@ static const char *get_output_charset (struct binding *domainbinding); typedef struct transmem_list { struct transmem_list *next; - char data[ZERO]; + char data[0]; } transmem_block_t; static struct transmem_list *transmem_list; #else diff --git a/intl/gettextP.h b/intl/gettextP.h index 869d25051e..d7f4c56d9d 100644 --- a/intl/gettextP.h +++ b/intl/gettextP.h @@ -195,10 +195,6 @@ struct loaded_domain unsigned long int nplurals; }; -/* We want to allocate a string at the end of the struct. But ISO C - doesn't allow zero sized arrays. */ -# define ZERO 0 - /* A set of settings bound to a message domain. Used to store settings from bindtextdomain() and bind_textdomain_codeset(). */ struct binding @@ -206,7 +202,7 @@ struct binding struct binding *next; char *dirname; char *codeset; - char domainname[ZERO]; + char domainname[0]; }; /* A counter which is incremented each time some previous translations