[TUHS] C entry keyword

Warner Losh imp at bsdimp.com
Tue Oct 30 23:56:54 AEST 2018


I'd imagine you'd use it like so (in more modern C):

void *memcpy(void *src, void *dst, size_t len)
{
char *rv = dst;
top:
while (len--) *dst++ =*src; /* not always a trivial body */
return(rv);
entry bcopy:
rv = dst; /* Swap args and jump to memcpy */
dst = src;
src = rv;
goto top:
}

Variations on this theme are often done in assembler for these routines,
though the example is an attempt to cope with the diversity of interfaces
that grew up after v6 unix was released in the world, so it's not likely
this particular example inspired it...

Warner

On Tue, Oct 30, 2018 at 4:00 AM Angelo Papenhoff <aap at papnet.eu> wrote:

> On 30/10/18, Steve Simon wrote:
> >
> > “entry” was a reserved word in K&R Ed.1,
> > my personal favourite C trivia. I have never seen it used outside
> fortran on mainframes though.
>
> I think PL/1 on Multics uses it, which is probably how it "got into" C.
>
> aap
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20181030/f89da94b/attachment.html>


More information about the TUHS mailing list