From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 31263 invoked from network); 25 Apr 2020 02:51:58 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with UTF8ESMTPZ; 25 Apr 2020 02:51:58 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id 7CE189C746; Sat, 25 Apr 2020 12:51:57 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id BDBAE9C733; Sat, 25 Apr 2020 12:51:44 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cZEL3vWe"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id B52CF9C733; Sat, 25 Apr 2020 12:51:43 +1000 (AEST) Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) by minnie.tuhs.org (Postfix) with ESMTPS id 05DE59C171 for ; Sat, 25 Apr 2020 12:51:43 +1000 (AEST) Received: by mail-vk1-f174.google.com with SMTP id q200so3295813vka.13 for ; Fri, 24 Apr 2020 19:51:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=OhkfUhE2gALoomOCGilh9QALRXc+CSHhwUHI76Msw30=; b=cZEL3vWecmoLDqZhW3qbNnfFNFDFxANy2sgb9v8mTTJrFnPl2gT5TJhQ7x4tpEqhkr SO3Hm7+JZoutSJkLx4jMjZPtSC0PKjbcjoxfE2YH+3bB6Uvnjon7b41wEU+i6ihzYk47 TnuTWTjP8T8GquHRzy2EQqOKqus0QLLaxl2ZG7Pv5II77ROSLWTIzZiAdHD9kbpA9d7G xRItMpjwgsevFoyulXxFCnTurZ7I1ukKdC10Hwgqn4zLSV4c/szJg/+Vw/tSbTZ7XyAo BNayjvUG6Sed3eGyT1pxWCZs0KgyUw7PL2kK4o4kX0lVUrvFKm0a18TlbVNaCK+w4N7z jG0w== 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=OhkfUhE2gALoomOCGilh9QALRXc+CSHhwUHI76Msw30=; b=OfJdWMyCSZKnkyJ0cw0T491C+CR4aguHcrImNizqMAJgtjg+Yao84OAoPkecSGWfxl hXXro9/li6sE9Jd2tnIZ4docnTc//rG/bEHOgYVPOYbBYF8cZF0cJ+Q4XHKfhTbPgWpG YW8IowKi2avXhy6h6q0cBsjU322mpm9SexweNMKfSnSlXUCxTGZM0kVoaS0Vvm7NjPUp Hu9fqEYd0XMKBBAIKJZ3JqY9jxlyayETuSmb4YiftbbpwxkxvvQRzE0d4cx43oBhsOsE blwQxor5ewUtQMCKKqpMsBJEKhfCCZRPjVc5inDDW7Dc+3iIDMGFBmLyA/GwvthHseQW zHmQ== X-Gm-Message-State: AGi0PubNYZ/CZafJZJAqc0Eu4JtrVp2or+BnkcdoC5ZgyK7npwuWsTis 4x1WotAH/rUgjOXs6jui2JpYdOmvAih4QPZaEcanyg== X-Google-Smtp-Source: APiQypJImMjnBslfq4i2bieGwtGUuYbURh2S5JklJd078bN8OsvgLBY5mlOmY/TWc4j2ZtcEjMWkqvCpfPyt2bgXXvU= X-Received: by 2002:a1f:c504:: with SMTP id v4mr10504811vkf.21.1587783102037; Fri, 24 Apr 2020 19:51:42 -0700 (PDT) MIME-Version: 1.0 References: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> In-Reply-To: <6D6EFA0C-36C3-4225-A331-D1998A07C50A@gmail.com> From: Rob Pike Date: Sat, 25 Apr 2020 12:51:31 +1000 Message-ID: To: Adam Thornton Content-Type: multipart/alternative; boundary="000000000000c7066805a4148fcd" Subject: Re: [TUHS] v7 K&R C 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: The Eunuchs Hysterical Society , ak@akkartik.com Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --000000000000c7066805a4148fcd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The ability to call a function pointer fp with the syntax fp() rather than (*fp)() came rather late, I think at Bjarne's suggestion or example. Pretty sure it was not in v7 C, as you observe. Convenient though the shorthand may be, it always bothered me as inconsistent and misleading. (I am pretty sure I used it sometimes regardless.) -rob On Sat, Apr 25, 2020 at 12:48 PM Adam Thornton wrote: > > > On Apr 24, 2020, at 7:37 PM, Charles Anthony > wrote: > > > > On Fri, Apr 24, 2020 at 7:00 PM Adam Thornton wrote= : > >> This doesn=E2=80=99t like the function pointer. >> > >> $ cc -c choparg.c >> choparg.c:11: Call of non-function >> >> Perhaps: > > (*fcn)(arg); > > > We have a winner! > > Also, Kartik, dunno where it is on the net, but if you install a v7 > system, /usr/src/cmd/c > > Adam > > --000000000000c7066805a4148fcd Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The ability to call a function pointer fp with the syntax = fp() rather than (*fp)() came rather late, I think at Bjarne's suggesti= on or example. Pretty sure it was not in v7 C, as you observe.

Convenient though the shorthand may be, it always bothered=C2=A0me a= s inconsistent and misleading. (I am pretty sure I used it sometimes regard= less.)

-rob


On Sat, Apr 25= , 2020 at 12:48 PM Adam Thornton <athornton@gmail.com> wrote:


=
On Apr 24, 2020, at 7:37 PM, Charles Anthony= <charle= s.unix.pro@gmail.com> wrote:



On Fri, Apr 24, 2020 at 7:00 PM Adam Thornton <athornton@gmail.com> wr= ote:
This d= oesn=E2=80=99t like the function pointer.

$ cc -c choparg.c
choparg.c:11: Call of non-function
Perhaps:

=C2=A0 =C2= =A0 (*fcn)(arg);


We have a winner!

Also, Kartik, dunno where it is on the net, but if you install a v7 syste= m, /usr/src/cmd/c

Adam

--000000000000c7066805a4148fcd--