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=-1.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17667 invoked from network); 15 May 2022 15:49:32 -0000 Received: from tb-ob1.topicbox.com (64.147.108.173) by inbox.vuxu.org with ESMTPUTF8; 15 May 2022 15:49:32 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob1.topicbox.com (Postfix) with ESMTP id 574732F80C for ; Sun, 15 May 2022 11:49:31 -0400 (EDT) (envelope-from bounce.mM7092e86f1d4c6f710af49d81.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id 54A8E2405B56; Sun, 15 May 2022 11:49:31 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type:list-help:list-id :list-post:list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1652629771; bh=0g7L1Wq65u7VDySC RFZfMqd64deWs5jbVbJrug2d6o8=; b=d1tSptlWkjc6zVHzmNprBFTO1+8DAgf3 P4GJ9WFxL5H9aijoyNv1n6Y1nBdU5kJA2J+xPQMaMGQqtWs1HjdXzFxkCB1svgeJ Lz0dJdOHzdv7MRXP/+okC8oUW9A5zmzZh+Dmsafu9P6i0F8EDohKpKxwQfkXXNlP PyKgYcGaixY= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1652629771; b=naGN12NAf1I9eOku5oCdzJM6KYzgt3Vw2II48XaCuz9mQawKmv hwCOPvYF7XgnwYiFDF5miJaRGSw+2azLZRX8dRWngywZ02iFEDFkhtFP2NqZwTmk GvpnkO7bkyWOUMrccxAvRKpN6fLzwQB/9mrY7lGhT62N3EdnNfx3Va12Y= Authentication-Results: topicbox.com; arc=pass; dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h=date:from :to:subject:in-reply-to:message-id:references:mime-version :content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; bh=UPslcOIxzHYtvEhc1fsD1YPA0u2+/5wNSugOkcGA4nw=; b=VcCY0BmBgMY/ zDgDnJLiDqEsCgaFCH0lbZmOzyPTAZaxIwFDFoakWTA4/F+8N/JAIosI73nZLYY7 i0vD+P9O2aasGOj5eMXRHc2evNPELv5/D5iT/jqUe8L1Riwq+Zr2w+yLTEh9mznW 0QzYXREBWe2ZWtJRLhVEVl8NnF1PPWQ= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id A4CA1240573A for <9fans@9fans.net>; Sun, 15 May 2022 11:49:18 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 1C744EA368C; Sun, 15 May 2022 11:49:18 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1652629758; b=h5fYb5y/+HCdumtjTv7TqiMGD21bBV1rxDIY2F1gY5cbryFz4w 5Yx5Vbzxu5aXjGgbgaVuPEtj6hnZikyGaSz4M3+fvaUAplN8Qu8y2mnOekVL/tih nNvqus5ky0+nvyl9vv+7lMCHsNwcZdeW/4fNU6UkSMXEvqna8zxrwuzFIvb/QuFw pbs5P/yziuc33RYVjM2Pgn004vooZz8fLgeeEG4/MOiissmiZXOy7weOQEuywr8e t2AjY8oDc+S+WOHiZhJjWMjcyXaQB3cgX2HatKQDvFLQw9KAJV3jr9fH26AOslJa rfMBm4J1G9Ki27kzW8KE3vxC6OkA0XR4VBJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=date:from:to:subject:in-reply-to:message-id :references:mime-version:content-type; s=arcseal; t=1652629758; bh=uCA5krsIrKJN+aEnvWpG1mL9zo3Mp72Xi/Y9VgGCD4Q=; b=MXLanJnvVr0t 4Zd9wkmL3Qk7IFD93PE9fKLzCRZys6DzkuwtoEpj+AC+zo597qEZP+iU8OEXCtYP HR0D+NXrHWl5PwGvuoWhU3Th60A/Bz3uRSs/OVYuiTGdOUUCOJFnpo+FZTbUnvNW wRvqj1NxoX0brSX2bMUqcGbCE6jyMZ/HTG9kEOe9m4hLDpVvs8iqXiyogFG1YWoK uv7tbCmaz/5MfDrhgqFYuvZy/WXFlEhiz36sqN6UDgCQrJcgdbuNBfE7exCnBpCL eeNZ/dqbxVK5Qn6jN+0gQmtngs+/FDBSnw8q0768w1CTgRDrNMylNPQNy9rGBnOq uBlCdfM9GA== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=none (no signatures found); dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=none policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=none,d=none,d.eval=none) policy.policy-from=p header.from=sdf.org; iprev=pass smtp.remote-ip=205.166.94.24 (mx.sdf.org); spf=pass smtp.mailfrom=adr@SDF.ORG smtp.helo=mx.sdf.org; x-aligned-from=pass (Address match); x-me-sender=none; x-ptr=pass smtp.helo=mx.sdf.org policy.ptr=mx.sdf.org; x-return-mx=pass header.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-return-mx=pass smtp.domain=sdf.org policy.is_org=yes (MX Records found: mx.sdf.org); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgedvfedrheefgdelfecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffujg fkfhggtgesthdtredttddtvdenucfhrhhomheprggurhcuoegrughrsefufffhrdfqtffi qeenucggtffrrghtthgvrhhnpeekhedtveffheevhfdtgefhhefgveelvedujeetjedthe duvdefvdekgedtfffhffenucfkphepvddthedrudeiiedrleegrddvgedpvddthedrudei iedrleegrdduieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpe dvtdehrdduieeirdelgedrvdegpdhhvghlohepmhigrdhsughfrdhorhhgpdhmrghilhhf rhhomhepoegrughrsefufffhrdfqtffiqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (sdf.org: 205.166.94.24 is authorized to use 'adr@SDF.ORG' in 'mfrom' identity (mechanism 'ip4:205.166.94.0/24' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="adr@SDF.ORG"; helo=mx.sdf.org; client-ip=205.166.94.24 Received: from mx.sdf.org (mx.sdf.org [205.166.94.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx0.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Sun, 15 May 2022 11:49:16 -0400 (EDT) (envelope-from adr@SDF.ORG) Received: from sdf.org (IDENT:adr@sdf.org [205.166.94.16]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 24FFnEsY029530 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO) for <9fans@9fans.net>; Sun, 15 May 2022 15:49:14 GMT Received: from localhost (adr@localhost) by sdf.org (8.15.2/8.12.8/Submit) with ESMTP id 24FFnDxv008023 for <9fans@9fans.net>; Sun, 15 May 2022 15:49:14 GMT Date: Sun, 15 May 2022 15:49:13 +0000 (UTC) From: adr To: 9fans <9fans@9fans.net> Subject: Re: [9fans] void* In-Reply-To: <93C8C37CBACFF2EA1B7D96EF381C93E4@eigenstate.org> Message-ID: <249582cc-285-c02-7779-ccc21b7a7267@SDF.ORG> References: <93C8C37CBACFF2EA1B7D96EF381C93E4@eigenstate.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 977736f0-d466-11ec-b131-e8cb0e998560 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZWNhZWEzYjllYzhlNzA2Ni1NNzA5MmU4NmYxZDRjNmY3MTBhZjQ5?= =?UTF-8?B?ZDgxPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: quoted-printable List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M7092e86f1d4c6f710af49d81:1:YkmWtezktOTyFURzg2hooMLLSNDFzlwtxbf2s9vzJtI On Sun, 15 May 2022, ori@eigenstate.org wrote: >> On Sun, 15 May 2022, arnold@skeeve.com wrote: >> >>> It allows you pass pointers of any type without requiring casts: >>> >>> struct foo s[5] =3D ... >>> memmove(s, & s[1], 4 * sizeof(struct foo)); // shift down 1 >>> >>> The compiler won't complain because any pointer type can be passed >>> to a void* parameter. Otherwise you'd need to cast: >>> >>> memmove((uchar*) s, (uchar*) & s[1], 4 * sizeof(struct foo)); >> >> Sure, but you could change it to do the same with char*. >> > > char* has legitimate uses for things other than generic pointers, > and the conversion complaints catch bugs. My point here is that It makes more sense to me to use a generic pointer which have a size (the type it points) of 1, so arithmetic can be applied to it. Of course I'm not proposing to change the compiler and all the code. It was just a reflection. Allowing arithmetic on void* solves the problem. Reading the definition of void this could look incongruous, but C99 already specifies: "A pointer to void shall have the same representation and alignment require= ments as a pointer to a character type" So I don't see any real trouble to allow the same operations as with char*. Again, just some thoughts. The comments about uchar* or uint8* are because arithmetic on void* brakes the concept of void, I don't really like it. But sometime things are doomed to staid as they are, even if they don't make sense... adr. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tecaea3b9ec8e7066-M7092e= 86f1d4c6f710af49d81 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription