Using &LABEL
The devil himself
daemon at decwrl.UUCP
Thu Aug 30 23:55:23 AEST 1984
Using &LABEL___________________________________________________________________
> You can take the address of a label using "&foo".
> By the way, is there anything useful you can do with this feature?
> Use it as a function address? Assigned goto's??? Something else?????
Good question. I never use goto's, so I never use labels. (I may use
a goto someday, but so far I've never had to.) I could imagine horrible things
like passing the address of a label to another function and executing a goto.
Anyone who does that should probably be strung up by their thumbs.
VMS RMS has a system function, sys$open(), that takes three arguments:
(1) the address of a File Access Block (FAB), (2) the address of a user-written
error completion routine (optional), and (2) the address of a user-written suc-
cess completion routine (also optional).
I thought I could use &LABEL to see if the "user-written routine" had
to be a function or just an entry-point, but VAX C doesn't allow use of &LABEL.
Perhaps someone out there running a different type of C on a VMS system could
try it.
Finally, is &LABEL an officially sanctioned K&R construct? I don't
have my copy with me so I can't look it up right now...
<_Jym_>
:::::::::::::::: Jym Dyer
::::' :: `:::: Nashua, New Hampshire
::' :: `::
:: :: :: DYER%VAXUUM.DEC at DECWRL.ARPA
:: .::::. :: {allegra|decvax|ihnp4|ucbvax}!decwrl!dec-rhea!dec-vaxuum!dyer
::..:' :: `:..::
::::. :: .:::: Statements made in this article are my own; they might not
:::::::::::::::: reflect the views of |d|i|g|i|t|a|l| Equipment Corporation.
More information about the Comp.lang.c
mailing list