From unknown Fri Jun 20 07:13:37 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77835 <77835@debbugs.gnu.org> To: bug#77835 <77835@debbugs.gnu.org> Subject: Status: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings Reply-To: bug#77835 <77835@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:13:37 +0000 retitle 77835 [PATCH] Pacify GCC 15 -Wunterminated-string-initialization wa= rnings reassign 77835 emacs submitter 77835 Collin Funk severity 77835 normal tag 77835 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 01:24:32 2025 Received: (at submit) by debbugs.gnu.org; 16 Apr 2025 05:24:32 +0000 Received: from localhost ([127.0.0.1]:60984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4vGB-00076s-Ds for submit@debbugs.gnu.org; Wed, 16 Apr 2025 01:24:31 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42656) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4vG8-00076H-Ky for submit@debbugs.gnu.org; Wed, 16 Apr 2025 01:24:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4vG2-0008SN-76 for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2025 01:24:22 -0400 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u4vG0-0004FR-G1 for bug-gnu-emacs@gnu.org; Wed, 16 Apr 2025 01:24:21 -0400 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-22c3407a87aso3772485ad.3 for ; Tue, 15 Apr 2025 22:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744781059; x=1745385859; darn=gnu.org; h=mime-version:user-agent:message-id:date:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=g5uNqTG4hHE5YhoUlltmN56b12gBcPDKNpqzoQatR9I=; b=DUZYfS8XutI0hXwo1YbAJl+MpGO9Y7rkCUzSotSiA3oWXuBI8kzffhoN2dHF0I1wx3 NouphYq584YU0xyHMwOGvaJmtb5Xv0jppmWPgIvvYcITFcUMwagRbfM1bc7UZx8gd1eV qz2Zbxa5IKkq/2apFwLwdfAArWC/nO/jqyc8j8NFH936Pk0JxbkyIf14/2Xu0g5Jhinx E7JQEzAc4f3Uae7F7lHR5k2xL8hC47nvzgNp7lyh0PvJqEKMgrtTs+tzMUHbMmi8DunP Jc/jqW0wi7WzUXnV0EzyXqL2kyedJfF/BOZC/beyhMZOhf0JAkgXc18Oapl/Uo62K/TV T3Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744781059; x=1745385859; h=mime-version:user-agent:message-id:date:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g5uNqTG4hHE5YhoUlltmN56b12gBcPDKNpqzoQatR9I=; b=Dx0dfPtpy/MrqOdFWP3Ozr1BXEmqnppo7Sjx5lSmswjjsO+CsEdu69q639PgCExGGG vxyvpLtLFz3fQzi9RnTgzEmDncW0GlkiTjZ+0/cHsDQL2cNypMe+SehCV2Niyk6IFdTI Nf2bwXPQsBVLXLEUGArmdJGcImEomdq0UB3ZPp+lPJ8YestVkmlYnDirF0//RuqjXCIK IHM/jp3sZ6NO2o2vJjqTcEtPumMwYKfMVngU6If1IU++H6ehikXGlIbPFf0j46LQDQVo I+vpdu8jMvyYcrHmU5Xo7nxh2t2ZJNF8yVVIxQZyyuj9sTdb3H5BqLlH98glTTHQRbgf assQ== X-Gm-Message-State: AOJu0YwklWudkkX38hv4AF21LVUIB+FDph0/eBv5W20QPq+WBeBDMsey LyaVU2DsAb3yUwjYu5ovLs6XgWJqG2S+HTH30VDl5mLhp/j9dv8e/PiEYw== X-Gm-Gg: ASbGnctMbGjrFQV9JOXFI2pfqxOqVr3VRsp/pWesHrEB4RCov2zBZuyXyu/ALNevSQo k8Y6DSXwZEEwk+8YHUl/u+Q85TD3EP5YbONxS0N3dbX8EmQXlxnHp0xmkGtKVAU/opGMa0dND/I FI8fTzlV6AU6cvb4ZugtmuYVoW7fKZGmwa9gGU6MJ70byncuGzZXJ/1CYGtGayI0qSca3WLdazm 80ecIWb9i8mDlzjBKPXFSDmiUEE30Vi9/fwfcoCPlR1vmIqwjez5jT6leX6AmAomzwQZ6VTatEp ssfEQ4YgRfBX+CYiwNRp9IRnhJKMTXaxSFhjKu3uNEt2VkYtHuMYPw3Wb2m7/wRxfmGgSKgbVKw qUg== X-Google-Smtp-Source: AGHT+IESY3Egh2QJQC719lLo6dmG4yoswb3YxO9c7UmbpL1Ul+IB35WUtCwmNhNhcuMHowMSOlKEhg== X-Received: by 2002:a17:902:ccc5:b0:224:23be:c569 with SMTP id d9443c01a7336-22c358e3773mr10704335ad.22.1744781058627; Tue, 15 Apr 2025 22:24:18 -0700 (PDT) Received: from fedora (static-198-54-131-150.cust.tzulo.com. [198.54.131.150]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c33fa5febsm4972305ad.117.2025.04.15.22.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Apr 2025 22:24:18 -0700 (PDT) From: Collin Funk To: bug-gnu-emacs@gnu.org Subject: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings Date: Tue, 15 Apr 2025 22:24:16 -0700 Message-ID: <87sem83chr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=collin.funk1@gmail.com; helo=mail-pl1-x634.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.2 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: GCC 15.0 enables -Wunterminated-string-initialization when using '-Wall -Wextra', which gets used when I run './configure'. This patch silences the warnings: fns.c: In function ‘hexbuf_digest’: fns.c:6019:40: warning: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 av [...] Content analysis details: (1.2 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2001:470:142:0:0:0:0:17 listed in] [list.dnswl.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (collin.funk1[at]gmail.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (collin.funk1[at]gmail.com) 1.0 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.2 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable GCC 15.0 enables -Wunterminated-string-initialization when using '-Wall -Wextra', which gets used when I run './configure'. This patch silences the warnings: fns.c: In function =E2=80=98hexbuf_digest=E2=80=99: fns.c:6019:40: warning: initializer-string for array of =E2=80=98char=E2=80= =99 truncates NUL terminator but destination lacks =E2=80=98nonstring=E2=80= =99 attribute (17 chars into 16 available) [-Wunterminated-string-initializ= ation] 6019 | static char const hexdigit[16] =3D "0123456789abcdef"; | ^~~~~~~~~~~~~~~~~~ Collin --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Pacify-GCC-15-Wunterminated-string-initialization-wa.patch >From 1df4a867e9440885a5de846eb6fcd17e327fc328 Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 15 Apr 2025 22:14:53 -0700 Subject: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings * src/fns.c: Include . (hexbuf_digest): Mark a variable with ATTRIBUTE_NONSTRING. * src/json.c: Include . (json_out_string): Mark a variable with ATTRIBUTE_NONSTRING. --- src/fns.c | 3 ++- src/json.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fns.c b/src/fns.c index 3f109a81836..94367d69557 100644 --- a/src/fns.c +++ b/src/fns.c @@ -19,6 +19,7 @@ Copyright (C) 1985-2025 Free Software Foundation, Inc. #include +#include #include #include #include @@ -6016,7 +6017,7 @@ hexbuf_digest (char *hexbuf, void const *digest, int digest_size) for (int i = digest_size - 1; i >= 0; i--) { - static char const hexdigit[16] = "0123456789abcdef"; + static char const hexdigit[16] ATTRIBUTE_NONSTRING = "0123456789abcdef"; int p_i = p[i]; hexbuf[2 * i] = hexdigit[p_i >> 4]; hexbuf[2 * i + 1] = hexdigit[p_i & 0xf]; diff --git a/src/json.c b/src/json.c index 5795c582ce0..7a34a5042c6 100644 --- a/src/json.c +++ b/src/json.c @@ -19,6 +19,7 @@ Copyright (C) 2017-2025 Free Software Foundation, Inc. #include +#include #include #include #include @@ -323,7 +324,7 @@ json_out_string (json_out_t *jo, Lisp_Object str, int skip) { /* FIXME: this code is slow, make faster! */ - static const char hexchar[16] = "0123456789ABCDEF"; + static const char hexchar[16] ATTRIBUTE_NONSTRING = "0123456789ABCDEF"; ptrdiff_t len = SBYTES (str); json_make_room (jo, len + 2); json_out_byte (jo, '"'); -- 2.49.0 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 16 05:40:58 2025 Received: (at 77835) by debbugs.gnu.org; 16 Apr 2025 09:40:59 +0000 Received: from localhost ([127.0.0.1]:35129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u4zGK-0001KL-Hh for submit@debbugs.gnu.org; Wed, 16 Apr 2025 05:40:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54948) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u4zGF-0001IU-Bp for 77835@debbugs.gnu.org; Wed, 16 Apr 2025 05:40:53 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u4zG8-0005NS-S0; Wed, 16 Apr 2025 05:40:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=kzrfqmiE6b/6xAhZJ26oKi1z0DiefE2kEBsiUeic14s=; b=Mbohm1yaLpCI4QvKD4+D keN7ICTaKnYfgHS7S4HsaJwJLtmjZtdV4jCES2LLvvAleNfIQWzzu5zcV2H8IlavDlRdSWiBD+R8y AzmYEoPu1sE4W7AoAa3UCCkKae70QDkjtmEltHJQdJE7gFrikQw9L7CDFeQC5dNpKVDA7GNCMcpT5 08Az9RPszbtDg0jijIkcZbx2Xyr8l+AJenC47xAO+bVF5TJD/lATEgZY92553qX9sNtLf4MmeY/WH FP3PmbSOmQGxJfnAnUIZvEvVSCNWLC9rE2pS2j0xsW08WwJhFJNfRpI+fqHhN70pdntd++ulOYGFR RjyWBP8do7UVng==; Date: Wed, 16 Apr 2025 12:40:40 +0300 Message-Id: <86ecxsfnqf.fsf@gnu.org> From: Eli Zaretskii To: Collin Funk , Paul Eggert In-Reply-To: <87sem83chr.fsf@gmail.com> (message from Collin Funk on Tue, 15 Apr 2025 22:24:16 -0700) Subject: Re: bug#77835: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings References: <87sem83chr.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77835 Cc: 77835@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Collin Funk > Date: Tue, 15 Apr 2025 22:24:16 -0700 > > GCC 15.0 enables -Wunterminated-string-initialization when using > '-Wall -Wextra', which gets used when I run './configure'. This patch > silences the warnings: > > fns.c: In function ‘hexbuf_digest’: > fns.c:6019:40: warning: initializer-string for array of ‘char’ truncates NUL terminator but destination lacks ‘nonstring’ attribute (17 chars into 16 available) [-Wunterminated-string-initialization] > 6019 | static char const hexdigit[16] = "0123456789abcdef"; > | ^~~~~~~~~~~~~~~~~~ Thanks. > >From 1df4a867e9440885a5de846eb6fcd17e327fc328 Mon Sep 17 00:00:00 2001 > From: Collin Funk > Date: Tue, 15 Apr 2025 22:14:53 -0700 > Subject: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings > > * src/fns.c: Include . > (hexbuf_digest): Mark a variable with ATTRIBUTE_NONSTRING. > * src/json.c: Include . > (json_out_string): Mark a variable with ATTRIBUTE_NONSTRING. > --- > src/fns.c | 3 ++- > src/json.c | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/src/fns.c b/src/fns.c > index 3f109a81836..94367d69557 100644 > --- a/src/fns.c > +++ b/src/fns.c > @@ -19,6 +19,7 @@ Copyright (C) 1985-2025 Free Software Foundation, Inc. > > #include > > +#include > #include > #include > #include > @@ -6016,7 +6017,7 @@ hexbuf_digest (char *hexbuf, void const *digest, int digest_size) > > for (int i = digest_size - 1; i >= 0; i--) > { > - static char const hexdigit[16] = "0123456789abcdef"; > + static char const hexdigit[16] ATTRIBUTE_NONSTRING = "0123456789abcdef"; > int p_i = p[i]; > hexbuf[2 * i] = hexdigit[p_i >> 4]; > hexbuf[2 * i + 1] = hexdigit[p_i & 0xf]; > diff --git a/src/json.c b/src/json.c > index 5795c582ce0..7a34a5042c6 100644 > --- a/src/json.c > +++ b/src/json.c > @@ -19,6 +19,7 @@ Copyright (C) 2017-2025 Free Software Foundation, Inc. > > #include > > +#include > #include > #include > #include > @@ -323,7 +324,7 @@ json_out_string (json_out_t *jo, Lisp_Object str, int skip) > { > /* FIXME: this code is slow, make faster! */ > > - static const char hexchar[16] = "0123456789ABCDEF"; > + static const char hexchar[16] ATTRIBUTE_NONSTRING = "0123456789ABCDEF"; > ptrdiff_t len = SBYTES (str); > json_make_room (jo, len + 2); > json_out_byte (jo, '"'); IMO, this is unnecessarily complex, and will also need us to make sure this attribute is supported everywhere. Doesn't the below fix the problem? Paul, WDYT? diff --git a/src/fns.c b/src/fns.c index 3f109a8..6e7943f 100644 --- a/src/fns.c +++ b/src/fns.c @@ -6016,7 +6016,7 @@ hexbuf_digest (char *hexbuf, void const *digest, int digest_size) for (int i = digest_size - 1; i >= 0; i--) { - static char const hexdigit[16] = "0123456789abcdef"; + static char const hexdigit[17] = "0123456789abcdef"; int p_i = p[i]; hexbuf[2 * i] = hexdigit[p_i >> 4]; hexbuf[2 * i + 1] = hexdigit[p_i & 0xf]; diff --git a/src/json.c b/src/json.c index 5795c58..94a82df 100644 --- a/src/json.c +++ b/src/json.c @@ -323,7 +323,7 @@ json_out_string (json_out_t *jo, Lisp_Object str, int skip) { /* FIXME: this code is slow, make faster! */ - static const char hexchar[16] = "0123456789ABCDEF"; + static const char hexchar[17] = "0123456789ABCDEF"; ptrdiff_t len = SBYTES (str); json_make_room (jo, len + 2); json_out_byte (jo, '"'); From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 20 01:41:49 2025 Received: (at 77835-done) by debbugs.gnu.org; 20 Apr 2025 05:41:50 +0000 Received: from localhost ([127.0.0.1]:43368 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6NR4-0005zM-IQ for submit@debbugs.gnu.org; Sun, 20 Apr 2025 01:41:49 -0400 Received: from mail.cs.ucla.edu ([131.179.128.66]:39076) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6NQy-0005y4-TY for 77835-done@debbugs.gnu.org; Sun, 20 Apr 2025 01:41:43 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id 21ADF3C010841; Sat, 19 Apr 2025 22:41:35 -0700 (PDT) Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10032) with ESMTP id NEouzsoMxqey; Sat, 19 Apr 2025 22:41:35 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.cs.ucla.edu (Postfix) with ESMTP id E85C43C010844; Sat, 19 Apr 2025 22:41:34 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 mail.cs.ucla.edu E85C43C010844 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=9D0B346E-2AEB-11ED-9476-E14B719DCE6C; t=1745127695; bh=99X1nspNomO625dmqCy8QXL0PQb189fXZ64vwL3oQ4s=; h=Message-ID:Date:MIME-Version:To:From; b=FMHSR+fDoI14WYbiBg8KFRbZAhSgOiuCfpgIl0ObA1kUs4xs7t7DskWStM7Xseg8m dPOdQB2lqiFcARft+8gAEmSpy2KFoPqeOKtUw//VsxH5pCqtYBf4T61lgEBNfApvsu IOv6+gpxvTkuvAvkAP0wpLBZjGmCUM7hO486JYmrQGbwasaM1W2JfNsnPlhUY8hNSV 2uz0IpRoMHGzNhNlSMboj54iqwTNii7wTdcytLdwSxphvRt62iKajICpO+1jmWufaW jf3kHVeNEu7MpMBl751+AwAYL56G3fZLHeNKP2ZpyEPRksigu6CNhn+ZYbY33mM8TL A41D6ErvYQzmA== X-Virus-Scanned: amavis at mail.cs.ucla.edu Received: from mail.cs.ucla.edu ([127.0.0.1]) by localhost (mail.cs.ucla.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id kVxh5Zh5GnuJ; Sat, 19 Apr 2025 22:41:34 -0700 (PDT) Received: from [192.168.254.12] (47-147-225-25.fdr01.snmn.ca.ip.frontiernet.net [47.147.225.25]) by mail.cs.ucla.edu (Postfix) with ESMTPSA id C69203C010841; Sat, 19 Apr 2025 22:41:34 -0700 (PDT) Content-Type: multipart/mixed; boundary="------------Eo0B0VR9xFZ0nZzmqLwANehn" Message-ID: Date: Sat, 19 Apr 2025 22:41:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: bug#77835: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings To: Eli Zaretskii , Collin Funk References: <87sem83chr.fsf@gmail.com> <86ecxsfnqf.fsf@gnu.org> Content-Language: en-US From: Paul Eggert Organization: UCLA Computer Science Department In-Reply-To: <86ecxsfnqf.fsf@gnu.org> X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77835-done Cc: 77835-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) This is a multi-part message in MIME format. --------------Eo0B0VR9xFZ0nZzmqLwANehn Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025-04-16 02:40, Eli Zaretskii wrote: > - static char const hexdigit[16] = "0123456789abcdef"; > + static char const hexdigit[17] = "0123456789abcdef"; Although that would pacify GCC, it would make the code more confusing because it doesn't clearly indicate to the human reader that hexdigit is unusual because it is used only as a 16-element array, not as a null-terminated string. I ran into this problem independently and installed the obvious patch (attached). I didn't recall your email suggesting this other solution until just now. If you prefer the more-confusing solution please feel to install it, but at least please add comments explaining what's going on. Thanks. Closing the bug report as the bug is fixed now, one way or another. --------------Eo0B0VR9xFZ0nZzmqLwANehn Content-Type: text/x-patch; charset=UTF-8; name="0001-Pacify-GCC-15-Wunterminated-string-initialization.patch" Content-Disposition: attachment; filename*0="0001-Pacify-GCC-15-Wunterminated-string-initialization.patch" Content-Transfer-Encoding: base64 RnJvbSBlMmZiMTJhNDBjYTJiOTBkZmVkYmZlOTE2ZWQ4YTg3MzQ1Y2E4OWYxIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBTYXQsIDE5IEFwciAyMDI1IDE5OjIyOjM3IC0wNzAwClN1YmplY3Q6IFtQQVRD SF0gUGFjaWZ5IEdDQyAxNSAtV3VudGVybWluYXRlZC1zdHJpbmctaW5pdGlhbGl6YXRpb24K Ciogc3JjL2Zucy5jIChoZXhidWZfZGlnZXN0KToKKiBzcmMvanNvbi5jIChqc29uX291dF9z dHJpbmcpOgpBZGQgQVRUUklCVVRFX05PTlNUUklORyB0byBjaGFyYWN0ZXIgYXJyYXlzIHRo YXQgYXJlIG5vdCBzdHJpbmdzLgotLS0KIHNyYy9mbnMuYyAgfCAyICstCiBzcmMvanNvbi5j IHwgMiArLQogMiBmaWxlcyBjaGFuZ2VkLCAyIGluc2VydGlvbnMoKyksIDIgZGVsZXRpb25z KC0pCgpkaWZmIC0tZ2l0IGEvc3JjL2Zucy5jIGIvc3JjL2Zucy5jCmluZGV4IDUyZjY2N2E3 MmE1Li4yMTkxNmI2ZmI0NiAxMDA2NDQKLS0tIGEvc3JjL2Zucy5jCisrKyBiL3NyYy9mbnMu YwpAQCAtNjAxNCw3ICs2MDE0LDcgQEAgaGV4YnVmX2RpZ2VzdCAoY2hhciAqaGV4YnVmLCB2 b2lkIGNvbnN0ICpkaWdlc3QsIGludCBkaWdlc3Rfc2l6ZSkKIAogICBmb3IgKGludCBpID0g ZGlnZXN0X3NpemUgLSAxOyBpID49IDA7IGktLSkKICAgICB7Ci0gICAgICBzdGF0aWMgY2hh ciBjb25zdCBoZXhkaWdpdFsxNl0gPSAiMDEyMzQ1Njc4OWFiY2RlZiI7CisgICAgICBzdGF0 aWMgY2hhciBjb25zdCBoZXhkaWdpdFsxNl0gQVRUUklCVVRFX05PTlNUUklORyA9ICIwMTIz NDU2Nzg5YWJjZGVmIjsKICAgICAgIGludCBwX2kgPSBwW2ldOwogICAgICAgaGV4YnVmWzIg KiBpXSA9IGhleGRpZ2l0W3BfaSA+PiA0XTsKICAgICAgIGhleGJ1ZlsyICogaSArIDFdID0g aGV4ZGlnaXRbcF9pICYgMHhmXTsKZGlmZiAtLWdpdCBhL3NyYy9qc29uLmMgYi9zcmMvanNv bi5jCmluZGV4IGJlYWMyNDJiNzA5Li40NGVhZTY1M2ViNSAxMDA2NDQKLS0tIGEvc3JjL2pz b24uYworKysgYi9zcmMvanNvbi5jCkBAIC0zMjMsNyArMzIzLDcgQEAganNvbl9vdXRfc3Ry aW5nIChqc29uX291dF90ICpqbywgTGlzcF9PYmplY3Qgc3RyLCBpbnQgc2tpcCkKIHsKICAg LyogRklYTUU6IHRoaXMgY29kZSBpcyBzbG93LCBtYWtlIGZhc3RlciEgKi8KIAotICBzdGF0 aWMgY29uc3QgY2hhciBoZXhjaGFyWzE2XSA9ICIwMTIzNDU2Nzg5QUJDREVGIjsKKyAgc3Rh dGljIGNvbnN0IGNoYXIgaGV4Y2hhclsxNl0gQVRUUklCVVRFX05PTlNUUklORyA9ICIwMTIz NDU2Nzg5QUJDREVGIjsKICAgcHRyZGlmZl90IGxlbiA9IFNCWVRFUyAoc3RyKTsKICAganNv bl9tYWtlX3Jvb20gKGpvLCBsZW4gKyAyKTsKICAganNvbl9vdXRfYnl0ZSAoam8sICciJyk7 Ci0tIAoyLjQ4LjEKCg== --------------Eo0B0VR9xFZ0nZzmqLwANehn-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 20 04:10:15 2025 Received: (at 77835) by debbugs.gnu.org; 20 Apr 2025 08:10:15 +0000 Received: from localhost ([127.0.0.1]:44829 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6Pkl-0005LW-AA for submit@debbugs.gnu.org; Sun, 20 Apr 2025 04:10:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43278) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u6Pkj-0005Gp-9A for 77835@debbugs.gnu.org; Sun, 20 Apr 2025 04:10:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u6Pkd-0003tm-GS; Sun, 20 Apr 2025 04:10:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7KGTDQYvA+y0RvLy2AzRcEn0mkiXcYf4ufV76P5iA6o=; b=sh8E3tTp4Gle uuyjdey11LPVATuudx1g+d90rf3Oe7n50acW8gxADarkQvC0W6gI5eSfdFAXurBcvSbfmtjsZi8HC TGQt7C0asPaHn6Fcy/mjCYHAUwWtoUjZq1VlL0S10wwXOZSZYUspjNL7U2oZzzpsjkjoAb2ja0Ssy 3ayg5PHo67kCDr+3c3ziCrQkJchFlUSqe100Wrs+3df5oi/YoqDCv43a+NHSzoUAF2vS4NxLsInUX xmI37KGGh/PbTr5w+7KWK5cA6WWip8cFDoUyz8gP2qCKmttqU+oa6NzP/Yo6/aHrgag3JKI1mv1dt hbU67yxXWBnoOE+nTsrXEg==; Date: Sun, 20 Apr 2025 11:10:04 +0300 Message-Id: <868qnv6yoz.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-Reply-To: (message from Paul Eggert on Sat, 19 Apr 2025 22:41:33 -0700) Subject: Re: bug#77835: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings References: <87sem83chr.fsf@gmail.com> <86ecxsfnqf.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77835 Cc: 77835@debbugs.gnu.org, collin.funk1@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sat, 19 Apr 2025 22:41:33 -0700 > Cc: 77835-done@debbugs.gnu.org > From: Paul Eggert > > On 2025-04-16 02:40, Eli Zaretskii wrote: > > - static char const hexdigit[16] = "0123456789abcdef"; > > + static char const hexdigit[17] = "0123456789abcdef"; > > Although that would pacify GCC, it would make the code more confusing > because it doesn't clearly indicate to the human reader that hexdigit is > unusual because it is used only as a 16-element array, not as a > null-terminated string. > > I ran into this problem independently and installed the obvious patch > (attached). I didn't recall your email suggesting this other solution > until just now. If you prefer the more-confusing solution please feel to > install it, but at least please add comments explaining what's going on. How portable is the attribute you used to fix this? AFAICT, it is supported since GCC 4.8, but our INSTALL indicates that we support older versions of GCC. Or does Gnulib solve this? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 20 04:24:44 2025 Received: (at 77835) by debbugs.gnu.org; 20 Apr 2025 08:24:44 +0000 Received: from localhost ([127.0.0.1]:44900 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u6Pym-00065K-Gk for submit@debbugs.gnu.org; Sun, 20 Apr 2025 04:24:44 -0400 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]:59753) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u6Pyi-000651-Tk for 77835@debbugs.gnu.org; Sun, 20 Apr 2025 04:24:42 -0400 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-22c3407a87aso47110175ad.3 for <77835@debbugs.gnu.org>; Sun, 20 Apr 2025 01:24:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745137475; x=1745742275; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=pFea9v10LpGfJ6evioyF2W3gyl+TiI6W7m9Mj+DtR4c=; b=W5lYdBCmidt10gpvAOmjkLzlD4SSOtluoAqBigin/khy0/J37WgTQGck64t2UoPzOO COzAUD8VAm6SbU2wV4UbmCxGhsjBRbXT1aC+Yn7iZDybrzrdQspZ+gB7kegBS9oLogE5 3RSD5isHcqc8/QYY4BQBKt80HcSxYzNaX4+BWWpKn80pm/Xdam6n8wb8pNJ6S5hAESQD MvNViyB6i0u34SdmIpU3u0DMWypUu1SPmSSHAN30WmjWF7OpchyE33CyOVLsot52HZtr hgHH3GC+F5EPQ5g06taof7e9ilF/y6taA7EkB3G6ZqTWi4MG53t6DMFEEXnoUtv/Jz0v dkdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745137475; x=1745742275; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pFea9v10LpGfJ6evioyF2W3gyl+TiI6W7m9Mj+DtR4c=; b=NEjHxHsjrhdQh3/sNu91OP1oZdJ3/24j0kBgU+YEUl9pT+fUaZTddRQ/GOPdRxnj/T G3omLUI2FI4omWBS0erIKu5rKHzCvvweX0N3uY/hLC32MvqLVRCUKN9bLUZq3Ca81o+D Svv+j3dh+Nh7RV9D276h1AHi4h+khq2vJukhiLDYyCWOrCZkKWq+DICEkzXadU9W4HBs blJQ8XRIpYwXC+23hZL/pZWMAKDsMIGTbtoI0I2F6/tHWmrkN1gbyORq082NNpHUzCk1 lO7iwEgOsHcKtkpN6yfI1z5MaoZUgouqtcInXp8vDAZ9UwzO0V999S9lioPrZCDJnFQ5 pYOQ== X-Forwarded-Encrypted: i=1; AJvYcCU3q32ar/8FO5ZXlR+43bW3IhMzfU9VwUZuEjdtg7lyOG/y2aM2VK3+CNtn5TaKwik0f6Ikmw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyChvfEWiOCnL1Hj/HCFno0/VnEw1XkRmYEcbmurbIJ4mHK9a/F aMyXPRWGCib2ujisAM1n2ZdqUegEJ9Z+j5KNjjcEtlrvNDFo06K8zRXIeA== X-Gm-Gg: ASbGncud/TO8KIlUY2Zagfh7RZstyBjzqZ+p0lBEsc0X060J+4L5cYULASnAjzhN30B FT8Os5shxaMj1ylxRG8n2RYspCNFwvT9qfCq7uYFytYAxh8irhvXAz9ekwTPX6L01ny1UNxUE2L doxLiiV7blsDlKHc1llarg/Oc4rJcvciCm/0VAOdFTe1kFiOhT6xb/e1l2p1V4ay97g6pScTYVh sakKyVF6nDKfMkwm/1p+fSX/jrwqXvu8QvYJ9kA1hxea5Y2UK4kB+SzNnnXSL7Eh+J6MGNJphl6 WA32uczV3TRN1L01q/VbEQ== X-Google-Smtp-Source: AGHT+IEXZjvyxtXDjuq8a5Pvf/jeoBkPmAMmDrkODlh1jtXYBg1o9M1iPsjGOMCJwkOtY2GoGEV/yA== X-Received: by 2002:a17:903:410a:b0:223:536d:f67b with SMTP id d9443c01a7336-22c53607c21mr112118495ad.38.1745137474695; Sun, 20 Apr 2025 01:24:34 -0700 (PDT) Received: from fedora ([2601:646:8081:3770::16aa]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-22c50bd9949sm44757735ad.10.2025.04.20.01.24.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 20 Apr 2025 01:24:34 -0700 (PDT) From: Collin Funk To: Eli Zaretskii Subject: Re: bug#77835: [PATCH] Pacify GCC 15 -Wunterminated-string-initialization warnings In-Reply-To: <868qnv6yoz.fsf@gnu.org> References: <87sem83chr.fsf@gmail.com> <86ecxsfnqf.fsf@gnu.org> <868qnv6yoz.fsf@gnu.org> Date: Sun, 20 Apr 2025 01:24:33 -0700 Message-ID: <87wmbfb5q6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 77835 Cc: 77835@debbugs.gnu.org, Paul Eggert X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > How portable is the attribute you used to fix this? AFAICT, it is > supported since GCC 4.8, but our INSTALL indicates that we support > older versions of GCC. Or does Gnulib solve this? The ATTRIBUTE_* macros are equal to _GL_ATTRIBUTE_* defined in gnulib-common.m4. For older compilers it is defined to expand to nothing. So everything should work fine. Collin From unknown Fri Jun 20 07:13:37 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 May 2025 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator