🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #876

Re: Function returing pointer to function

#876
From: Doug Gwyn
Date: Thu, 09 Nov 1989 05:53
18 lines
1129 bytes
In article <90460@pyramid.pyramid.com> markhall@pyrps5.pyramid.com (Mark Hall) writes:
>Under K&R, one would define a function returning a funtion pointer as:
>	int ( * frfp () ) (p0, p1) int p0, p1; {}

I'm not sure K&R1 said that, but if so, they were wrong, since AT&T's
own PCC rejects that with two "syntax error" diagnostics.

>You *cannot* define this function as:
>	int ( * frfp (p0,p1) ) () int p0, p1; {}

And PCC accepts this one.

>... is this a quiet change, or is there something I've overlooked?

It's sure not a quiet change in UNIX practice.

I don't know of any compilers that required the former construct
instead of the latter.
Technical Details
Message-ID: <11569@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!samsung!aplcen!haven!adm!smoke!gwyn
References: <90460@pyramid.pyramid.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!samsung!aplcen!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn)
Newsgroups: comp.std.c
Subject: Re: Function returing pointer to function
Message-ID: <11569@smoke.BRL.MIL>
Date: 9 Nov 89 05:53:34 GMT
References: <90460@pyramid.pyramid.com>
Reply-To: gwyn@brl.arpa (Doug Gwyn)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 18