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_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2056 invoked from network); 16 May 2022 14:47:00 -0000 Received: from tb-ob0.topicbox.com (64.147.108.117) by inbox.vuxu.org with ESMTPUTF8; 16 May 2022 14:47:00 -0000 Received: from tb-mx0.topicbox.com (tb-mx0.nyi.icgroup.com [10.90.30.73]) by tb-ob0.topicbox.com (Postfix) with ESMTP id B570D34A03 for ; Mon, 16 May 2022 10:46:58 -0400 (EDT) (envelope-from bounce.mM057b5e29e604b46338b87e89.r522be890-2105-11eb-b15e-8d699134e1fa@9fans.bounce.topicbox.com) Received: by tb-mx0.topicbox.com (Postfix, from userid 1132) id B0E08243015D; Mon, 16 May 2022 10:46:58 -0400 (EDT) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=QouGmgOj header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=charles.forsyth@gmail.com smtp.helo=mail-oi1-f175.google.com; 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=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:list-help:list-id:list-post :list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1652712418; bh=GB7Gb51xH2MhcrpT ADTeoaBrUPD53l5y1qtIKQRx214=; b=i+UIxERguGvYzcu++F9UhbmOSOMdSp4D JbDGEiQFfmxLnkACPoM7VSmnJWHROFx5J0FW8rkKn/SlA4X75E9lmgt3/0/SFqca H70CjLvfvC5a+zDxRbNb2fVi+qh+LMA7FFit/WAazbr8rG992p8Gy3GMSYm/Guit yNjIcIuX4EY= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1652712418; b=F7TCcPu7rrko0dzHnpzYO199mXEGV5eQobZLeQRV8UQmKwQuLF NiKCA1FIDj4y4+Y8YFGS2Oa2/K99+X2k5cZYkKE9EOVtp3EkZ8k1kmDzB0UmC5v3 Ip9MYigVfKVeo4J8LALN/xHFPPsajrbHIiRVUURhW6f7R+uY2hu8i7NXs= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=QouGmgOj header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=charles.forsyth@gmail.com smtp.helo=mail-oi1-f175.google.com; 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=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=QouGmgOj header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.175 (mail-oi1-f175.google.com); spf=pass smtp.mailfrom=charles.forsyth@gmail.com smtp.helo=mail-oi1-f175.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=RuQoOYI2; x-me-sender=none; x-ptr=pass smtp.helo=mail-oi1-f175.google.com policy.ptr=mail-oi1-f175.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); 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= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; bh=ocCEO5YOIr4+XsV9h3XYA8l211Ouv8vCw/W4lDV8EBQ=; b=IoYwflvbsrws sNoQepCN0n3gsPqu+rKsJSqn+3V6N3sl2YKTdbhM+MNTS6pg2wBx+QldvIIPmCGc Oqfh9YJo/KLaIFI1rezH3FN/UEJy8mKzOhyakCWBQnkBAaZBXuq9wiQqcBHOsAYz 6+dB0kZTRY7V9ZgXKrSsMpiWa1vyyK4= Received: from tb-mx0.topicbox.com (localhost.local [127.0.0.1]) by tb-mx0.topicbox.com (Postfix) with ESMTP id 88C67242FC21 for <9fans@9fans.net>; Mon, 16 May 2022 10:46:39 -0400 (EDT) (envelope-from charles.forsyth@gmail.com) Received: from tb-mx0.topicbox.com (localhost [127.0.0.1]) by tb-mx0.topicbox.com (Authentication Milter) with ESMTP id 31141D01571; Mon, 16 May 2022 10:46:39 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1652712399; b=XuQwF97JbWSJ+1V9JkvdOTRtBeVS5DD3Nt1V+fMmiywgu6VdLY oXjpX81fEsQPOHABdOyph7YvOtKY+1icf05IXZVdGbZphDcH1WIE/Y5JB8/tw7Oc k5OiVtqCg9MVH6+7PlgnQPePzKDyR3hmSbI7WyHtZV5DXSFVDUkEiH5adeCdrABz i85oSgLplFrm/01jWnXLEMD6vZr+5SwXHBQgf6ZGlaReb30KO7weikWvY0LOKUbu OSYv36J8VN4TPe8f5wVF5tfk0a3tMjWdHbGa8Kc+KCTd4GkkwwjUEmv8QEKMQ3zF 4b47zHJo7EZX0C8UtOaCE/G6cNgke4PwwUvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=arcseal; t=1652712399; bh=t20rCQ7VWClWeJ5Su3iQ7A3P0LQXaJTsleS6lxms7q4=; b=uV1AtNDTREdn RmtY1OF3uP5Or3wSVjXtyNHYFrihJLr5cQvlB0qmw/DeY9ct+6vxrDTDrdGiyFo8 LeRbJPVYwkoAjUdkE/QQS8clUiyQz6xqtPO8sTbEJ6aQk8EdSGxgVYMt4XcMz78a 4H94a7ZvLvH+Sv+/cgKsOnsL8scv4XnEFeqECREZq+0kIu2FnOKcdajKz/nho5pI hFrOKlwv/NQJWszUarHRNuqTqjQ8o9S1T8Eq+yBHxMPociwyN44+mWOC3DK166YE KIu/zkV39qjfWIyIKWYh2YPScJ6Vdw1UxdTs6qdSMGN9BXqrlFTkn8JgNdPACCqk 5tp9EUwYhA== ARC-Authentication-Results: i=1; tb-mx0.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=QouGmgOj header.a=rsa-sha256 header.s=20210112 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.175 (mail-oi1-f175.google.com); spf=pass smtp.mailfrom=charles.forsyth@gmail.com smtp.helo=mail-oi1-f175.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=RuQoOYI2; x-me-sender=none; x-ptr=pass smtp.helo=mail-oi1-f175.google.com policy.ptr=mail-oi1-f175.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); 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: gggruggvucftvghtrhhoucdtuddrgedvfedrheehgdejkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjgfhff fkuffvtgesrgdtreertddtjeenucfhrhhomhepvehhrghrlhgvshcuhfhorhhshihthhcu oegthhgrrhhlvghsrdhfohhrshihthhhsehgmhgrihhlrdgtohhmqeenucggtffrrghtth gvrhhnpeeffeethfevhfevteejtdfhieefieevheejledvgeevvdeglefgvedtlefggeei keenucffohhmrghinhepthhophhitggsohigrdgtohhmnecukfhppedvtdelrdekhedrud eijedrudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpedv tdelrdekhedrudeijedrudejhedphhgvlhhopehmrghilhdqohhiuddqfhdujeehrdhgoh hoghhlvgdrtghomhdpmhgrihhlfhhrohhmpeeotghhrghrlhgvshdrfhhorhhshihthhes ghhmrghilhdrtghomheq X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'charles.forsyth@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx0.topicbox.com; identity=mailfrom; envelope-from="charles.forsyth@gmail.com"; helo=mail-oi1-f175.google.com; client-ip=209.85.167.175 Received: from mail-oi1-f175.google.com (mail-oi1-f175.google.com [209.85.167.175]) (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>; Mon, 16 May 2022 10:46:39 -0400 (EDT) (envelope-from charles.forsyth@gmail.com) Received: by mail-oi1-f175.google.com with SMTP id q10so18843072oia.9 for <9fans@9fans.net>; Mon, 16 May 2022 07:46:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=t20rCQ7VWClWeJ5Su3iQ7A3P0LQXaJTsleS6lxms7q4=; b=RuQoOYI2Z/ne6mN2LJXcgdd0NVQ2VZK9CnP14uCjB3nFgwMrQGG93EbeHflXURF54Z KDnf0vaI5H5Fo9VCfilTxvWJNpcOfVEIPBAbcxB1TtPlPfquxGTHOU7AmwA1B1vjjVLt UF5y/6/h5ElspEXTfJMGVWj9bjH2PSPiOdRbQb1PZ8aQbwIYiCBgc8GjFYSFCyaW+08T 933/oI79O2y695lOZLEF3Q2CYnw261I+872vElQ7cXm0QbAYuSA31sKDdZxvfdON4nKE sjoWjeFyC6bBidlPyTSGBoOyvvr/KF+NSNR5kAhSaJq7EB3fTSdvKSmpq+X1zNRgdJRy rEbA== X-Gm-Message-State: AOAM532weZ9dp/bMXnxpAX6sFkEYEytV2qPOo1dgBW/DttfmmiVnLg51 vgVpFIgQLdKxPepRhaavrMmSEIx5ETTc9GVJn4wz36oWUsc= X-Google-Smtp-Source: ABdhPJx3Wr3hgQDoT6z8egiK73cjyXCjI8iZWdeXMH7pWfX2N0hwcaZBr558w23lTJ6BJ9w4SOF0bymxIxYSQiWMvGQ= X-Received: by 2002:a05:6808:1815:b0:328:e631:d103 with SMTP id bh21-20020a056808181500b00328e631d103mr4759645oib.218.1652712398147; Mon, 16 May 2022 07:46:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Charles Forsyth Date: Mon, 16 May 2022 15:46:27 +0100 Message-ID: Subject: Re: [9fans] void* To: 9fans <9fans@9fans.net> Content-Type: multipart/alternative; boundary=00000000000068532605df2217ad Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: 01533630-d527-11ec-a104-98c527351525 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UZWNhZWEzYjllYzhlNzA2Ni1NMDU3YjVlMjllNjA0YjQ2MzM4Yjg3?= =?UTF-8?B?ZTg5Pg==?= 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: 7bit List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:M057b5e29e604b46338b87e89:1:es8r7sGmyza2pbw8WJeokUgUWNGLGL6uJaUfMVKmyWI --00000000000068532605df2217ad Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable it's void* because that can be assigned between other pointer types without a cast. x =3D malloc(sizeof(*x)); instead of x =3D (T*)malloc(sizeof(*x)); which ju= st adds clutter. Similarly it's just free(x) instead of free((void*)x); (or free((uchar*)x) as I understand your suggestion). On Sun, 15 May 2022 at 11:59, adr wrote: > Hi, > one of the first thing I noticed compiling in plan9 is that arithmetic > on void* is illegal. Other compilers treat void* as uchar*. > Conceptually, it makes sense. A pointer to void doesn't point to > any object. But then I've seen the use of void* in functions (like > memccpy) when the pointed object is going to be processed as a > byte array. Local uchar*'s are used to do the trick inside the > function. >=20 > It wouldn't make more sense to avoid the use of void* > and just use instead uchar* or better still u8int*? >=20 > Some thoughts? >=20 > Regards, > adr. ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tecaea3b9ec8e7066-M057b5= e29e604b46338b87e89 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --00000000000068532605df2217ad Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
it's void* because that can be assigned be= tween other pointer types without a cast.
x =3D malloc(sizeof(*x)); ins= tead of x =3D (T*)malloc(sizeof(*x)); which just adds clutter.
Si= milarly it's just free(x) instead of free((void*)x); (or free((uchar*)x= ) as I understand your suggestion).


=
On Sun, 15= May 2022 at 11:59, adr <adr@sdf.org&= gt; wrote:
Hi,=
one of the first thing I noticed compiling in plan9 is that arithmetic
on void* is illegal. Other compilers treat void* as uchar*.
Conceptually, it  makes sense. A pointer to void doesn't point to<= br /> any object. But then I've seen the use of void* in functions (like
memccpy) when the pointed object is going to be processed as a
byte array. Local uchar*'s are used to do the trick inside the
function.

It wouldn't make more sense to avoid the use of void*
and just use instead uchar* or better still u8int*?

Some thoughts?

Regards,
adr.

------------------------------------------
9fans: 9fans
Permalink: https:= //9fans.topicbox.com/groups/9fans/Tecaea3b9ec8e7066-M7d5d7a58e7e77b74d2aa12= 3a
Delivery options: https://9fans.topicbox.com/gro= ups/9fans/subscription
= --00000000000068532605df2217ad--