From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 06A8C389442C for ; Mon, 12 Apr 2021 06:05:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 06A8C389442C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Paul.Zimmermann@inria.fr IronPort-HdrOrdr: =?us-ascii?q?A9a23=3A43OWlqOJCB1scMBcTuyjsMiAIKoaSvp033AA?= =?us-ascii?q?3SlKJiB9X8SEm6mV98gz+gTzjF8qNU0IudfFA6WYRGOZyJgd2+csFJOvRhPvtm?= =?us-ascii?q?ftDIwK1+Hf6gbtESH/6eJRvJ0IG5RWM9H+AUN3isz3+mCDc+oI+sWN86yjmI7l?= =?us-ascii?q?rktFcAcCUc1d0zs=3D?= X-IronPort-AV: E=Sophos;i="5.82,214,1613430000"; d="scan'208";a="378361027" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Apr 2021 08:05:16 +0200 Date: Mon, 12 Apr 2021 08:05:16 +0200 Message-Id: From: Paul Zimmermann To: Paul Eggert Cc: libc-alpha@sourceware.org In-Reply-To: (message from Paul Eggert on Sun, 11 Apr 2021 14:42:22 -0700) Subject: Re: Fix REALLOC_ZERO_BYTES_FREES comment References: X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Apr 2021 06:05:21 -0000 Dear Paul, > From: Paul Eggert > Date: Sun, 11 Apr 2021 14:42:22 -0700 > > While looking into problems with glibc's documentation of > malloc/free/etc. I noticed that the comment for REALLOC_ZERO_BYTES_FREES > was out of date: its reference to "the C standard" refers to ISO C11, > but that compatibility problem has been fixed in C17. I installed the > attached commentary fix as obvious. > > [2:text/x-patch Show Save:0001-Fix-REALLOC_ZERO_BYTES_FREES-comment-to-match-C17.patch (1kB)] you write "If nonzero, ... should free p .... Otherwise ... should do the equivalent of freeing p". Is there a difference between "free p" and "do the equivalent of freeing p"? Also "ISO C17 says the behavior is implementation-defined here": I guess you mean the "default value of REALLOC_ZERO_BYTES_FREES", since for me the behavior is what is described above. Paul