From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28974 invoked from network); 9 Apr 2021 04:18:39 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Apr 2021 04:18:39 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617941919; b=yX1l40khCU6lsenndQ8hcnIzZn6B/UJGSOC4dlPfzD6PZV0149ZicYewoobs+CQ9rxDF1YEb7/ C+8g4gHkvs30E2gBWHKp9x7zFWItkCDDeXkQu1EhJAzWVKXPVPKywlVmjiMc3I+lw1dA53oXXZ 0lutVG5dAfx4sNCHqQNgdj0Qg5E7FNXgHTODgkTjhMmSdZ75ytEHV3MBTU6S00WMAbEiLkazoU 7cEBbMhOTRjP/tnTVdRyc4HJshjMABbDsG3f0QGXCdS5tYcdSbHrO/Dcl4jHEPU19N2akMEbyP c2Ry4TKyFBg5ED5U0ShYjVwMg6b7G57azH6f3Adsla6VwA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (snd00012-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.12; dmarc=none header.from=kba.biglobe.ne.jp; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617941919; bh=azQskmdmOgJaTnMj3eCjiT5+sJpMVXwVMljbHo//L7k=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Message-ID:In-Reply-To:To:References:Date:Subject: MIME-Version:Content-Transfer-Encoding:Content-Type:From:DKIM-Signature; b=j4eeGEEe/gUUuhLBHb5wqH/2pGBbuxkikLCNPJ6VmEfDCO4waHcLHHQ20yUWDjhqN+vhFW6xaQ 0PMMsQFx56hdGkF+nT3eUlI4M1IPm/hS8FG0RSh+KcLGDcp09iBmoUyg48EOxmJ74ejEiuP5lc CdLPEaLxamXvinVrgXqRTdAKbfcTfMhO5butMtueKJP2BwSdS787KsMJ4vhfcgz7sIsb79oplc k8oZtMvTs2IdqRGB8/spukIqvWGKwnTP/uwuNgo7hUJarqFB0B10g7cMiKlKo6fby2qsWPqo8b XxKXyw1R3+y/bb6pvUnXXk8FYTuiYfdRzdwvjK5W/aX+uQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Message-Id:In-Reply-To:To:References: Date:Subject:Mime-Version:Content-Transfer-Encoding:Content-Type:From: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=SohCjMD1NJgfj4ayCiFKo9k1xAm1fYQp8WYLMxKI4Jc=; b=D2r+Nkp+bpDgakxKhMk52mEFog esGRXU1KO1xK4Aol08LCEN6bndCB3bG8CeNOy1pTwquz0XolItUFFm8mD8QTKlOHemIUNIloB1zsF XeE7KXXEiAFEpx+xrgKXabOv47Rlhk889eEr8R81+v5tV7HpWm6LtXCx0fYl93oZwYM8naj/dP/Dr iZZnG84TF+e0hnz+ekw8WmL528GU+kKbCHfwOcn42EeAdHLNKo3EVgMt3FCr9CfHvQoxzIzutN49D TBQdHOjas+0dxvAup0Mw4e/qMyRkSAOWOVs4HPSXWXOLDfSIecqG7d1iqFWpK//w6DLRxZd51aB/q 2Hy74+hg==; Received: from authenticated user by zero.zsh.org with local id 1lUibO-0003lz-5N; Fri, 09 Apr 2021 04:18:38 +0000 Authentication-Results: zsh.org; iprev=pass (snd00012-bg.im.kddi.ne.jp) smtp.remote-ip=27.86.113.12; dmarc=none header.from=kba.biglobe.ne.jp; arc=none Received: from snd00012-bg.im.kddi.ne.jp ([27.86.113.12]:7648 helo=omta0004.biglobe.ne.jp) by zero.zsh.org with esmtp id 1lUias-0003XP-4S; Fri, 09 Apr 2021 04:18:08 +0000 Received: from mail.biglobe.ne.jp by omta0004.biglobe.ne.jp with ESMTP id <20210409041801982.MHJK.45330.mail.biglobe.ne.jp@biglobe.ne.jp> for ; Fri, 9 Apr 2021 13:18:01 +0900 From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: [PATCH 3/3] autoconf: prepare for 2.70 Date: Fri, 9 Apr 2021 13:18:01 +0900 References: <20201231054131.682544-1-felipe.contreras@gmail.com> <20201231054131.682544-4-felipe.contreras@gmail.com> <8940db24-8c70-45a6-8d3b-71047c1ce3b5@www.fastmail.com> <8638a7d8-418c-4065-be5d-21d42d693c56@www.fastmail.com> <57530-1617921898.773095@9HdU.NV4Y.7xMR> To: zsh-workers@zsh.org In-Reply-To: <57530-1617921898.773095@9HdU.NV4Y.7xMR> Message-Id: <6C8E81D3-E859-4C65-97D0-90E614816619@kba.biglobe.ne.jp> X-Mailer: Apple Mail (2.3445.104.17) X-Biglobe-Sender: takimoto-j@kba.biglobe.ne.jp X-Seq: 48439 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: > 2021/04/09 7:44, Oliver Kiddle wrote: >=20 > Both this and the preceding part 1 patch look completely fine to me. > I've read through this and checked against a couple of different = systems > and don't see an issue but I can't claim to be following what is new > with autoconf 2.70. Unless anyone sees a reason to object, I'll apply > these. I also tested on a few systems and fund no problems. I think mem.c can be further simplified as follows (discard unnecessary = macros): PS Are there any systems that still require --enable-zsh-mem? diff --git a/Src/mem.c b/Src/mem.c index 5951e57ed..fb4be47bf 100644 --- a/Src/mem.c +++ b/Src/mem.c @@ -1072,19 +1072,6 @@ zrealloc(void *ptr, size_t size) # endif #endif =20 -#if defined(_BSD) && !defined(STDC_HEADERS) -# define FREE_RET_T int -# define FREE_ARG_T char * -# define FREE_DO_RET -# define MALLOC_RET_T char * -# define MALLOC_ARG_T size_t -#else -# define FREE_RET_T void -# define FREE_ARG_T void * -# define MALLOC_RET_T void * -# define MALLOC_ARG_T size_t -#endif - /* structure for building free list in blocks holding small blocks */ =20 struct m_shdr { @@ -1198,8 +1185,8 @@ static struct m_hdr *m_l; =20 #endif /* ZSH_MEM_DEBUG */ =20 -MALLOC_RET_T -malloc(MALLOC_ARG_T size) +void * +malloc(size_t size) { struct m_hdr *m, *mp, *mt; long n, s, os =3D 0; @@ -1226,7 +1213,7 @@ malloc(MALLOC_ARG_T size) #if 1 size =3D 1; #else - return (MALLOC_RET_T) m_high; + return (void *) m_high; #endif =20 queue_signals(); /* just queue signals rather than handling them = */ @@ -1284,7 +1271,7 @@ malloc(MALLOC_ARG_T size) #endif =20 unqueue_signals(); - return (MALLOC_RET_T) sh; + return (void *) sh; } /* we still want a small block but there were no block with a = free small block of the requested size; so we use the real = allocation @@ -1426,14 +1413,14 @@ malloc(MALLOC_ARG_T size) #endif =20 unqueue_signals(); - return (MALLOC_RET_T) (((char *)m) + sizeof(struct m_hdr)); + return (void *) (((char *)m) + sizeof(struct m_hdr)); } #ifdef ZSH_MEM_DEBUG m_m[m->len < (1024 * M_ISIZE) ? (m->len / M_ISIZE) : 1024]++; #endif =20 unqueue_signals(); - return (MALLOC_RET_T) & m->next; + return (void *) & m->next; } =20 /* this is an internal free(); the second argument may, but need not = hold @@ -1640,14 +1627,10 @@ zfree(void *p, int sz) unqueue_signals(); } =20 -FREE_RET_T -free(FREE_ARG_T p) +void +free(void *p) { zfree(p, 0); /* 0 means: size is unknown */ - -#ifdef FREE_DO_RET - return 0; -#endif } =20 /* this one is for strings (and only strings, real strings, real C = strings, @@ -1661,8 +1644,8 @@ zsfree(char *p) zfree(p, strlen(p) + 1); } =20 -MALLOC_RET_T -realloc(MALLOC_RET_T p, MALLOC_ARG_T size) +void * +realloc(void *p, size_t size) { struct m_hdr *m =3D (struct m_hdr *)(((char *)p) - M_ISIZE), *mt; char *r; @@ -1673,12 +1656,12 @@ realloc(MALLOC_RET_T p, MALLOC_ARG_T size) queue_signals(); r =3D malloc(size); unqueue_signals(); - return (MALLOC_RET_T) r; + return (void *) r; } =20 /* and some systems even do this... */ if (!p || !size) - return (MALLOC_RET_T) p; + return p; =20 queue_signals(); /* just queue signals caught rather than handling = them */ =20 @@ -1707,17 +1690,17 @@ realloc(MALLOC_RET_T p, MALLOC_ARG_T size) free(p); =20 unqueue_signals(); - return (MALLOC_RET_T) r; + return (void *) r; } =20 -MALLOC_RET_T -calloc(MALLOC_ARG_T n, MALLOC_ARG_T size) +void * +calloc(size_t n, size_t size) { long l; char *r; =20 if (!(l =3D n * size)) - return (MALLOC_RET_T) m_high; + return (void *) m_high; =20 /* * use realloc() (with a NULL `p` argument it behaves exactly the = same @@ -1729,7 +1712,7 @@ calloc(MALLOC_ARG_T n, MALLOC_ARG_T size) =20 memset(r, 0, l); =20 - return (MALLOC_RET_T) r; + return (void *) r; } =20 #ifdef ZSH_MEM_DEBUG