Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Debian is like Suse with yast turned off, just better. :) -- Goswin Brederlow


computers / comp.sys.transputer / INMOS C compiler Version 2.01.10 pitfall

SubjectAuthor
* INMOS C compiler Version 2.01.10 pitfallMike B.
`- Re: INMOS C compiler Version 2.01.10 pitfallcpm

1
INMOS C compiler Version 2.01.10 pitfall

<71d1399a-f87b-44ba-a2b8-cc3a1e6bd6ecn@googlegroups.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=116&group=comp.sys.transputer#116

 copy link   Newsgroups: comp.sys.transputer
X-Received: by 2002:ac8:5fd1:0:b0:3ba:240b:9997 with SMTP id k17-20020ac85fd1000000b003ba240b9997mr122425qta.36.1675724327227;
Mon, 06 Feb 2023 14:58:47 -0800 (PST)
X-Received: by 2002:a81:4884:0:b0:527:ada6:a82c with SMTP id
v126-20020a814884000000b00527ada6a82cmr101603ywa.495.1675724326939; Mon, 06
Feb 2023 14:58:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.transputer
Date: Mon, 6 Feb 2023 14:58:46 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=62.178.31.116; posting-account=SFOqlgkAAAAFnei08Ol39AT5SoPJtook
NNTP-Posting-Host: 62.178.31.116
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <71d1399a-f87b-44ba-a2b8-cc3a1e6bd6ecn@googlegroups.com>
Subject: INMOS C compiler Version 2.01.10 pitfall
From: michael_...@yahoo.com (Mike B.)
Injection-Date: Mon, 06 Feb 2023 22:58:47 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1830
 by: Mike B. - Mon, 6 Feb 2023 22:58 UTC

Hi!

I like to reuse the arguments of a C function passed by value. Why waste space. BUT - don't do that with the function arguments for a process!

#include <process.h>
#include <stdlib.h>
#include <stdio.h>

void newproc( Process *p, int arg1, int arg2, int arg3 ) {
p = p;
printf( "arg1=%d, arg2=%d, arg3=%d\n", arg1, arg2, arg3 );
arg3--;
arg2++; /* don't change process arguments even they were passed by value !!! */
}

int main( void ) {

Process *x;
int pa1 = 1, pa2 = 2, pa3 = 3;

if (( x = ProcAlloc( newproc, 0, 3, pa1, pa2, pa3 )) == NULL ) abort();

ProcPar( x, NULL );
ProcPar( x, NULL );
ProcPar( x, NULL );

return 0;
}

ubuntu@kria:~$ $ISERVER -sb proc.btl
arg1=1, arg2=2, arg3=3
arg1=1, arg2=3, arg3=2
arg1=1, arg2=4, arg3=1

-Mike

Re: INMOS C compiler Version 2.01.10 pitfall

<68f956a2-2be6-4e99-aea3-1a12b80c36abn@googlegroups.com>

 copy mid

https://www.novabbs.com/computers/article-flat.php?id=117&group=comp.sys.transputer#117

 copy link   Newsgroups: comp.sys.transputer
X-Received: by 2002:a0c:e510:0:b0:537:6a1e:d81e with SMTP id l16-20020a0ce510000000b005376a1ed81emr277691qvm.4.1675804606583;
Tue, 07 Feb 2023 13:16:46 -0800 (PST)
X-Received: by 2002:a05:6902:1242:b0:766:2e0a:55ff with SMTP id
t2-20020a056902124200b007662e0a55ffmr561541ybu.325.1675804606365; Tue, 07 Feb
2023 13:16:46 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.sys.transputer
Date: Tue, 7 Feb 2023 13:16:46 -0800 (PST)
In-Reply-To: <71d1399a-f87b-44ba-a2b8-cc3a1e6bd6ecn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=93.195.238.236; posting-account=MX8GggoAAABTx7k2Piq-gMAK-mm2-fFu
NNTP-Posting-Host: 93.195.238.236
References: <71d1399a-f87b-44ba-a2b8-cc3a1e6bd6ecn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <68f956a2-2be6-4e99-aea3-1a12b80c36abn@googlegroups.com>
Subject: Re: INMOS C compiler Version 2.01.10 pitfall
From: cpm...@t-online.de (cpm)
Injection-Date: Tue, 07 Feb 2023 21:16:46 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1594
 by: cpm - Tue, 7 Feb 2023 21:16 UTC

Hi Mike,

I agree that ProcAlloc and ProcPar may not be what a C programmer would expect.
ProcAlloc allocates and initializes the process according to the documentation. The function creates the process structure and sets the initial values.
ProcPar runs the process. In your case, you ran it three times in sequence without re-initializing.
The result we see seems reasonable.
If you want to reuse the process, you can reinitialize it with ProcInit.

Claus

1
server_pubkey.txt

rocksolid light 0.9.7
clearnet tor