Article View: comp.sys.mac
Article #24412Re: LSC prototypes question
From: Tom Kimpton
Date: Mon, 25 Jan 1988 04:23
Date: Mon, 25 Jan 1988 04:23
34 lines
1632 bytes
1632 bytes
In article <870113@hpcilzb.HP.COM> tedj@hpcilzb.HP.COM writes:
>
>I have a short L.S. C question: I have a function which is defined
>as:
>
> void myfun(x, y)
> register int x, y;
> {
> ...stuff...
> }
>
> and I tried to make a function prototype for it like this:
>
> void myfun(register int x, register int y);
>
>
> and I got the error message "invalid storage class". However when I
> removed the word "register" from the prototype, it compiled. What's the
> deal? Why isn't "register" a valid storage class? (I only have v.2.01
> of the documentation, and this error message wasn't in it...).
>
Just off the top of my head I would say that the protype is being used
to check the type of the passed in object, whereas in the declaration
the "register" refers to how the passed in object is used in the function,
i.e. COPIED into a register and all references made to that register.
Thus it doesn't make much sense (well maybe) to specify that the passed
in object must be a register variable.
--
Tom Kimpton {ihnp4,uunet}!iconsys!tom
Icon International, Inc. {ihnp4,psivax}!nrcvax!nrc-ut!iconsys!tom
Orem, Utah 84058 ARPANET: icon%byuadam.bitnet@wiscvm.wisc.edu
(801) 225-6888 BITNET: icon%byuadam.bitnet
Technical Details
Message-ID:
<193@iconsys.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!iconsys!tomReferences:
<870113@hpcilzb.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!iconsys!tom From: tom@iconsys.UUCP (Tom Kimpton) Newsgroups: comp.sys.mac Subject: Re: LSC prototypes question Message-ID: <193@iconsys.UUCP> Date: 25 Jan 88 04:23:31 GMT References: <870113@hpcilzb.HP.COM> Reply-To: tom@iconsys.UUCP (Tom Kimpton) Organization: Icon International Inc., Orem, Utah Lines: 34