🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5213

Re: function returning pointer to itself

#5213
From: Rick Coates
Date: Mon, 18 Jul 1988 21:57
46 lines
1548 bytes
In article <5485@batcomputer.tn.cornell.edu>, olson@batcomputer.tn.cornell.edu (olson) writes:
> Does the new C standard have a natural way to declare a
> function that returns a pointer to itself
> ????
> 
(deleted)
(several more articles, with obscure declartions)


Please forgive me if I'm missing something obvious here.....
(I used to be a hardware person - what can I say).

I just tried this out on the only dpANSI compiler I have available -
Microsoft C 5.1 for IBM pc's (this is ironic because I do a lot of work
on a Sun 4 - great machine but no ANSI C; I also work  on Masscomp machines,
which also have no ANSI compiler. When are the Big Boys (medium boys, anyway)
going to support ANSI C?).

This seems to work fine. Compiles with no errors or warnings.

Isn't this a reasonable use of void *   ???
It isn't even Ugly!
-------------program------------
void * test_func();

main()
{
    printf("test: %x\n",test_func);
}

void *
test_func()
{
    return test_func;
}
-------------results-------------

test: 24

---------------------------------

Rick Coates

tektronix!reed!percival!agora!rickc
OR
tektronix!sequent!islabs!ateq!rick
Technical Details
Message-ID: <1065@agora.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tektronix!percival!bucket!parsely!agora!rickc
References: <5485@batcomputer.tn.cornell.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tektronix!percival!bucket!parsely!agora!rickc
From: rickc@agora.UUCP (Rick Coates)
Newsgroups: comp.std.c
Subject: Re: function returning pointer to itself
Message-ID: <1065@agora.UUCP>
Date: 18 Jul 88 21:57:25 GMT
References: <5485@batcomputer.tn.cornell.edu>
Organization: Advanced Solutions, Hillsboro, OR
Lines: 46