I'm trying to provide an interim solution prior to some Vaxen
(5.5-2H4) being replaced with Alphas running somewhat more
recent versions of OVMS, which necesssitates me developing a
C program (to avoid the hideous error-handling problems of
DCL) to FTP some files to/from a U*ix box.
However, I'm encountering a problem whilst trying to use
mandatory globalvalue "definitions" that TCPWARE uses for
its error codes (TCPWARE_NONODE &etc.).
Okay, things are obviously a little bit out of date, but the
TCPWARE 5.1 programmer's reference manual says that in order
to access these codes, they need to be defined as globalvalues.
I don't have a problem with this (I've never used globalvalue
before, only globaldef and globalref, so you'll pardon my
ignorance if I don't understand why TCPWARE doesn't just use
header files and #defines), but I'm having a problem with the
use of the values.
If I try to reference the values using
int a = TCPWARE_NONODE ;
printf("\nValue of TCPWARE_NONODE is %d", TCPWARE_NONODE) ;
then this doesn't prove to be a problem.
However, if I do something like:
case TCPWARE_NONODE :
/* blah */
Then the DEC C compiler complains, saying that (in the caseQuote:}
statement) the TCPWARE_NONODE needs to be a constant, but
actually isn't (dialled in from PC at home at the moment, so
I don't recall the exact error message).
I've done a search on Google, and tried using references to
#pragma extern_model save
#pragma extern_model globalvalue
globalvalue TCPWARE_NONODE ;
#pragma extern_model restore
from a posting by Wayne Sewell (with me adding the globalvalue
reference as it appears here), to no avail.
On rereading the posting, I may have misspelt the "extern_model"
as "external_model" (but can't check just now), but the use of the
pragmas makes no difference, nor does it make any difference as to
whether or not /STANDARD=VAXC is used on the compilation.
Can anyone tell me what I'm doing wrong (and more importantly,
why?), and what benefits there are to using globalvalue on DEC C
or VAX C on a Vax, or plain old DEC C on an Alpha?
Are there any benefits at all, or is this just a peculiarity of
(extensions to) ANSI which would only be of use when porting to
I've also seen references to using "extern" as opposed to
"globalvalue" when using DEC C, and that it is an acceptable
alternative (according to one of the posts that the OpenVMS
Wizard shows on www.hp.com), but isn't (due to the obvious
default inference of "int") according to a comp.os.vms post,
and am somewhat perplexed.
Mark (who doesn't read his Vax and Alpha architecture reference
manuals on a regular basis)