From unknown Tue Aug 19 01:10:55 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#24392 <24392@debbugs.gnu.org> To: bug#24392 <24392@debbugs.gnu.org> Subject: Status: [INSTALLED PATCH 2/2] sort: port to strict C + valgrind Reply-To: bug#24392 <24392@debbugs.gnu.org> Date: Tue, 19 Aug 2025 08:10:55 +0000 retitle 24392 [INSTALLED PATCH 2/2] sort: port to strict C + valgrind reassign 24392 coreutils submitter 24392 Paul Eggert severity 24392 normal tag 24392 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 07 22:53:33 2016 Received: (at submit) by debbugs.gnu.org; 8 Sep 2016 02:53:33 +0000 Received: from localhost ([127.0.0.1]:53025 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhpT2-0002ue-Ts for submit@debbugs.gnu.org; Wed, 07 Sep 2016 22:53:33 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58091) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhpT0-0002uJ-Ky for submit@debbugs.gnu.org; Wed, 07 Sep 2016 22:53:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhpSu-0005Pc-QU for submit@debbugs.gnu.org; Wed, 07 Sep 2016 22:53:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:60812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhpSu-0005PK-Na for submit@debbugs.gnu.org; Wed, 07 Sep 2016 22:53:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49047) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhpSs-0003tl-FU for bug-coreutils@gnu.org; Wed, 07 Sep 2016 22:53:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhpSn-0005OZ-Fa for bug-coreutils@gnu.org; Wed, 07 Sep 2016 22:53:21 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:54752) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhpSn-0005OR-Aa for bug-coreutils@gnu.org; Wed, 07 Sep 2016 22:53:17 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DB50B1611D8 for ; Wed, 7 Sep 2016 19:53:16 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ShzuU1-IkiBc; Wed, 7 Sep 2016 19:53:16 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EAA60161198; Wed, 7 Sep 2016 19:53:15 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id U_0qq5wI6s6i; Wed, 7 Sep 2016 19:53:15 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id CA56C161123; Wed, 7 Sep 2016 19:53:15 -0700 (PDT) From: Paul Eggert To: bug-coreutils@gnu.org Subject: [INSTALLED PATCH 2/2] sort: port to strict C + valgrind Date: Wed, 7 Sep 2016 19:53:09 -0700 Message-Id: <1473303189-26249-2-git-send-email-eggert@cs.ucla.edu> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1473303189-26249-1-git-send-email-eggert@cs.ucla.edu> References: <1473303189-26249-1-git-send-email-eggert@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit Cc: 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: -4.0 (----) * bootstrap.conf (gnulib_modules): Add flexmember. * src/sort.c: Include flexmember.h. (struct tempnode): Make the last member flexible. (create_temp_file): Port to strict C11/C99 rules for allocation alignment with flexible array members. --- bootstrap.conf | 1 + src/sort.c | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bootstrap.conf b/bootstrap.conf index 985018f..8a0ff31 100644 --- a/bootstrap.conf +++ b/bootstrap.conf @@ -88,6 +88,7 @@ gnulib_modules=" filemode filenamecat filevercmp + flexmember fnmatch-gnu fopen-safer fprintftime diff --git a/src/sort.c b/src/sort.c index 0795475..b30f5d0 100644 --- a/src/sort.c +++ b/src/sort.c @@ -34,6 +34,7 @@ #include "error.h" #include "fadvise.h" #include "filevercmp.h" +#include "flexmember.h" #include "hard-locale.h" #include "hash.h" #include "heap.h" @@ -667,7 +668,7 @@ struct tempnode struct tempnode *volatile next; pid_t pid; /* The subprocess PID; undefined if state == UNCOMPRESSED. */ char state; - char name[1]; /* Actual size is 1 + file name length. */ + char name[FLEXIBLE_ARRAY_MEMBER]; }; static struct tempnode *volatile temphead; static struct tempnode *volatile *temptail = &temphead; @@ -855,7 +856,7 @@ create_temp_file (int *pfd, bool survive_fd_exhaustion) char const *temp_dir = temp_dirs[temp_dir_index]; size_t len = strlen (temp_dir); struct tempnode *node = - xmalloc (offsetof (struct tempnode, name) + len + sizeof slashbase); + xmalloc (FLEXSIZEOF (struct tempnode, name, len + sizeof slashbase)); char *file = node->name; struct cs_status cs; -- 2.7.4 From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 08 00:45:42 2016 Received: (at control) by debbugs.gnu.org; 8 Sep 2016 04:45:42 +0000 Received: from localhost ([127.0.0.1]:53068 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhrDZ-0000QE-Vp for submit@debbugs.gnu.org; Thu, 08 Sep 2016 00:45:42 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:45746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bhrDY-0000Q1-MH for control@debbugs.gnu.org; Thu, 08 Sep 2016 00:45:41 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id A36A9161123 for ; Wed, 7 Sep 2016 21:45:34 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id GvshdBC_7_Ni for ; Wed, 7 Sep 2016 21:45:33 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 6EFD51611D8 for ; Wed, 7 Sep 2016 21:45:33 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id YDmHeD-nzNNQ for ; Wed, 7 Sep 2016 21:45:33 -0700 (PDT) Received: from [192.168.1.9] (unknown [100.32.155.148]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 54AA2161123 for ; Wed, 7 Sep 2016 21:45:33 -0700 (PDT) To: control@debbugs.gnu.org From: Paul Eggert Subject: strict C + valgrind installed Organization: UCLA Computer Science Department Message-ID: <9c1e6ed1-5bc1-c906-213c-eb0458656d80@cs.ucla.edu> Date: Wed, 7 Sep 2016 21:45:29 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: control 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.1 (-) close 24391 close 24392 From unknown Tue Aug 19 01:10:55 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Oct 2016 11:24:05 +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