[TUHS] v7 K&R C

Rob Pike robpike at gmail.com
Sat Apr 25 12:51:31 AEST 2020


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 <athornton at gmail.com> wrote:

>
>
> On Apr 24, 2020, at 7:37 PM, Charles Anthony <charles.unix.pro at gmail.com>
> wrote:
>
>
>
> On Fri, Apr 24, 2020 at 7:00 PM Adam Thornton <athornton at gmail.com> wrote:
>
>> This doesn’t 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20200425/e39f48b2/attachment.html>


More information about the TUHS mailing list