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=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 2553 invoked from network); 31 May 2020 17:44:25 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 31 May 2020 17:44:25 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 32BA89C94A; Mon, 1 Jun 2020 03:44:24 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id 41CD493D52; Mon, 1 Jun 2020 03:44:01 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=bsdimp-com.20150623.gappssmtp.com header.i=@bsdimp-com.20150623.gappssmtp.com header.b="aeTD/0q1"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 27E6E93D46; Mon, 1 Jun 2020 03:43:59 +1000 (AEST) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) by minnie.tuhs.org (Postfix) with ESMTPS id 8BC2593D46 for ; Mon, 1 Jun 2020 03:43:58 +1000 (AEST) Received: by mail-qt1-f170.google.com with SMTP id i68so6021416qtb.5 for ; Sun, 31 May 2020 10:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5upfZn8aZWo8gFbQEWeMY21vpN2O/GCvfaalWbZEFho=; b=aeTD/0q1npRRmt6llUYa7fW7sTAyWtu4+QDBFVQPedMREG5H9uAVb2eFmLbvaxqSu4 AeJhaP3dTiyTSjm+fmB31r5/13B53D8h2HH16r9Fs+IxmOgiJoXaBbbIw8JACdCk1yap xZr9u5f1CZEVvLldNR1MeO8e6mXtwnhNCbsZ5oum5AtLojnS0xQAVifcbrsxtKtgQKpg PED+oucH8JTqgkWuuuksmsDjn9zL/q6Lve9DekzWqpxi47fHPSTwwOw4aKUdsBm7G0qM 68/339+lthz5Ncnlv0arf8EZP5ypUnjjPUfMQWKF24zcXqIXSWdcsBmSFQfRId6wX/+E FdQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5upfZn8aZWo8gFbQEWeMY21vpN2O/GCvfaalWbZEFho=; b=GUEv0ZnyUoiyXPomTON68lOLSb0T3+p4xqoDp1/HCeQl++60grb/rRtxlTczh9yXHq wEOoPhriBtCC0nBmZXHUm+U0qGBbnhtIN2LLFldCnK6Ti9ZmlBJBmHQd/ChByNA9gT23 G/PFaF8zRPJD59isgucVNE2xKYUszcJpnvMIDqxrE0oq2IjasA70ubIacFMUi3I/JHF9 Alh0a56VOhU3cJdRAr8kLNNgXtx3zFfwqwnbMIHQMNxdvn7BhyEuJQRg3GPl+M2d0g1i 8KEMbEBJxui59DIbkR6HRag0Qn1K0Mrqr13WjExI3qAkLnYIygpn1P/mP6iDUeCkiAM+ jEWA== X-Gm-Message-State: AOAM533QOxYlYZYmhCPiR2PFD88m5fl6OgkwcKA7zsp/AjU74EV7+DyH xGq3QevyNsN3ExsRDjeIBtH6/o8yce7xSPDyd0zmb+GsPA8= X-Google-Smtp-Source: ABdhPJyUgEwhjdaJUCmaZrx/33z6T9dcfBVI7f/4E3UIpTmf4Q9xshsQwfgBBQrC2rGLUZhWifxw1WcDMzEnPP6HbZM= X-Received: by 2002:aed:2d87:: with SMTP id i7mr5121827qtd.291.1590947037577; Sun, 31 May 2020 10:43:57 -0700 (PDT) MIME-Version: 1.0 References: <193c770d408ee131dbaa9a07dba6f068.squirrel@squirrelmail.tuffmail.net> In-Reply-To: <193c770d408ee131dbaa9a07dba6f068.squirrel@squirrelmail.tuffmail.net> From: Warner Losh Date: Sun, 31 May 2020 11:43:46 -0600 Message-ID: To: Ronald Natalie Content-Type: multipart/alternative; boundary="000000000000081a0005a6f539b3" Subject: Re: [TUHS] LSX on the PDP-11/03 (LSI-11) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: TUHS main list Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000081a0005a6f539b3 Content-Type: text/plain; charset="UTF-8" On Sun, May 31, 2020 at 6:34 AM wrote: > > > Anyway, I've tried compiling Hello World on LSX, and I get "1: External > > definition syntax" error. Some help would be nice, but more generally, is > > anyone on this list more than vaguely familiar with LSX, or 6th Edition > > itself? > > > > void main () { > > printf("Hello World!"); > > } > > > > It seems that the 7th Edition was the beginning of the standard library > in > > C, and that this is missing in LSX. I'm not sure if printf is an > intrinsic > > function in (6th Edition) C, or if it's from a library. > > > > First off, VOID MAIN is not legal in any standard version of C. Even when > the language allows implementation defined extensions to the main > signature, it must still return int. > > If you have a later version of language supported, you have to define > printf rather than allowing it default define as an int returning > function. > > Add #include > Or, alternatively, LSX is really old. The compiler there likely doesn't support 'void'. >From the lsx part of tuhs: # cp /dev/tty8 addr.c main() { int a; printf("main address: %u (0%o)\n", main, main); printf("stack address: %u (0%o)\n", &a, &a); printf("heap address: %u (0%o)\n", sbrk(0), sbrk(0)); } ^D # cc addr.c # a.out main address: 16410 (040032) stack address: 40934 (0117746) heap address: 17920 (043000) None of the disks appear to have a /usr/include. The only .h files look like they were from the kernel. Warner --000000000000081a0005a6f539b3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Sun, May 31, 2020 at 6:34 AM <<= a href=3D"mailto:ron@ronnatalie.com">ron@ronnatalie.com> wrote:
<= /div>

> Anyway, I've tried compiling Hello World on LSX, and I get "1= : External
> definition syntax" error. Some help would be nice, but more gener= ally, is
> anyone on this list more than vaguely familiar with LSX, or 6th Editio= n
> itself?
>
> void main () {
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0printf("Hello World!");
> }
>
> It seems that the 7th Edition was the beginning of the standard librar= y in
> C, and that this is missing in LSX. I'm not sure if printf is an i= ntrinsic
> function in (6th Edition) C, or if it's from a library.
>

First off, VOID MAIN is not legal in any standard version of C.=C2=A0 Even = when
the language allows implementation defined extensions to the main
signature, it must still return int.

If you have a later version of language supported, you have to define
printf rather than allowing it default define as an int returning
function.

Add #include <stdio.h>

Or, altern= atively, LSX is really old. The compiler there likely doesn't support &= #39;void'.

From the lsx part of tuhs:

# cp /dev/tty8 addr.c
main() {
=C2= =A0 int a;
=C2=A0 printf("main address: %u (0%o)\n", main, mai= n);
=C2=A0 printf("stack address: %u (0%o)\n", &a, &a)= ;
=C2=A0 printf("heap address: %u (0%o)\n", sbrk(0), sbrk(0));=
} =C2=A0 =C2=A0 =C2=A0
^D
# cc addr.c
# a.out
main address= : 16410 (040032)
stack address: 40934 (0117746)
heap address: 17920 (= 043000)

None of the disks appear to have a /usr/incl= ude. The only .h files look like they were from the kernel.

<= /div>
Warner
=C2=A0
--000000000000081a0005a6f539b3--