HPE Community read-only access December 15, 2018
This is a maintenance upgrade. You will be able to read articles and posts, but not post or reply.
Hours:
Dec 15, 4:00 am to 10:00 am UTC
Dec 14, 10:00 pm CST to Dec 15, 4:00 am CST
Dec 14, 8:00 pm PST to Dec 15, 2:00 am PST
Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Which version of DEC C or VMS introduced...?

 
Galen Tackett
Valued Contributor

Which version of DEC C or VMS introduced...?

I'm making some of my C code more backward compatible with older versions of DEC C and/or VMS. Can anyone help me determine which version of the DEC C compiler or its RTL or VMS (as appropriate) introduced the following:

* DECC$TYPES.H
* INTTYPES.H
* NETDB.H
* SECIDDEF.H
* STROPTS.H

* in SYIDEF.H, the symbols SYI$K_ARCH_NAME_* (*=VAX, Alpha, etc.)

* The inline keyword


Thanks,

Galen
14 REPLIES
Steven Schweda
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

I don't know, but:

> DECC$TYPES.H

Why not include ? _It_ should be
available everywhere, and it will pull in
DECC$TYPES.H if it thinks that that one
exists.

> SYI$K_ARCH_NAME_*

You can use #if[def] to test for specific
macros. If this works anything like the DCL
F$GETSYI() lexical, there's one code
(SYI$_HW_MODEL?) which works even on old VAX
systems, while the fancy new ones need new
VMS versions. Use the old stuff instead.
(Or, if the fancy new macro for a given
system type is missing, it may be a safe bet
that you're not on that type system.)

For any potentially missing header file,
can't you have one of your own in a directory
which appears down the list in the compiler's
/INCLUDE option, such that it'll get the
system file (or module) if it exists, and
yours if if there is no such system file (or
module)?
Galen Tackett
Valued Contributor

Re: Which version of DEC C or VMS introduced...?

Steve,

Thanks for your suggestions. I'd thought before about doing as you suggest for any or all of these, but I'd still prefer to have information that's as complete as possible. Partly just so that I can explain things in the comments.

Steven Schweda
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

Why do you need to know which version of
anything added a feature, if your code may,
but need not, use that feature?

The only times I seem to need any kind of
version info seem to be when particular
items in header files are conditional on
versions, like:

#if __CRTL_VER >= 70301000

And these things are usually tied only very
tenuously to compiler and/or VMS versions.

I'd settle for code+comments like:

#ifdef SYI$K_ARCH_NAME_whatever
/* Safe to use SYI$K_ARCH_NAME_whatever */
... modern actual code ...
#else /* def SYI$K_ARCH_NAME_whatever */
/* Must do it the hard way. */
... archaic actual code ...
#endif /* def SYI$K_ARCH_NAME_whatever [else] */

Or always do it the hard way, and mention
why.

It's your code, and you can waste all the
time you wish in any way(s) you wish, but I
don't see the point. Which is more
important, the presence or absence of a
feature, or the version of something where
it appeared?
Galen Tackett
Valued Contributor

Re: Which version of DEC C or VMS introduced...?

I guess there's a difference between NEEDING to know and WANTING to know...
Stanley F Quayle
Valued Contributor

Re: Which version of DEC C or VMS introduced...?

I do lots of development on Alpha V7.3-2 and then backport to VAX C V5.5 (although I can go back to V4.7, if necessary).

There are run-time library things that didn't exist in older versions of VMS. The LIB$ functions that work with time were added in VMS 5.0, for example.

If you want to use these newer functions, but need to keep compatability with old VMS, you'll have to use LIB$FIND_IMAGE_SYMBOL at runtime to find the "new" ones, and provide your own functions if they can't be found. Otherwise, you'll be unable to link on the old VMS system.

http://www.stanq.com/charon-vax.html
Brad McCusker
Respected Contributor

Re: Which version of DEC C or VMS introduced...?

I agree with previous statements about (generally) not coding to the information you are asking for.

One of the problems is that some C headers shipped with compilers, some shipped with the OS, and some shipped with both. And of those that fall into the "both" category, there were points in time where they may not have been in "both". Point is, there are other methods to deal with this in code.

But, you wanted to know, so, I'll tell you what I know.

STROPTS.H first appeared in the OpenVMS V7.1 timeframe.

INTTYPES.H seems to have surfaced around 1997, which Ithink would mean the V7.1 timeframe. Couldn't find a firm check-in to tie it to.

NETDB.H has been around on all Alpha versions.
Brad McCusker
Software Concepts International
Galen Tackett
Valued Contributor

Re: Which version of DEC C or VMS introduced...?

Brad,

Thanks! That's a good chunk of what I was asking for.

And thanks for the reminder about some of the files having shipped with both the O/S and the compiler and being out of sync between the two. I knew that from way back, but hadn't thought of it recently :-)

Since for most purposes I'm generally in agreement with the suggestions already given, I'd rather not prolong that part of this discussion.

I'm still curious about DECC$TYPES.H and SECIDDEF.H and the inline "storage class" keyword, if anyone happens to dig up when they first appeared. I'll leave this topic open for a little while just in case.

Thanks, all.

Galen

P.S. Though simple curiosity was a big part of why I asked this question, another is that one or more fairly large open source applications which I use (and may have somewhat customized--gawk for example) have a config.h that uses macros with names similar to HAVE_NETDB or HAVE_STROPTS.

By knowing this I could, if I wish, follow a pre-existing pattern in some of these config files, where these symbols are conditionally defined based on the O/S version being targeted or on the compiler version being used.

But as I say, I'd rather not get tangled up any further in the pros and cons since we're all in general agreement.
Steven Schweda
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

> [...] I'd rather not prolong [...]

Oh, you're no fun.

On my VMS VAX V5.4 system, I can find
"SYS$COMMON:[SYSLIB]NETDB.H;1", so it
probably came with VAX C, too.

DEC C V4.0-000 seems to have provided none
but (a newer) NETDB.H.

That should narrow down your search almost
imperceptibly. You're welcome.
Arch_Muthiah
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

Galen,

DECC$TYPES is in DECC$RTLDEF.TLB which came with my OpenVMS 7.3, the RTL version is 7.3 and I found this DECC$RTLDEF.TLB in HP C V6.5. I hope this would have been from VMS V7.2 onwords.


Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

Galen

Netdb introduced in VMS and CRTL version V7.0 onwords for have network sockets related declaration.

netdb.h was not available before VMS V7.0 and CRTL version V7.0


Archunan
Regards
Archie
Arch_Muthiah
Honored Contributor

Re: Which version of DEC C or VMS introduced...?


And as of OpenVMS Alpha Version 7.0, the new STARLET lib, that is SYS$LIBRARY:SYS$STARLET_C.TLB contains all c functions declaration including SECIDDEF.H.

Archunan
Regards
Archie
Galen Tackett
Valued Contributor

Re: Which version of DEC C or VMS introduced...?

Archunan,

> Netdb introduced in VMS and CRTL version V7.0 onwords for have network
> sockets related declaration.

> netdb.h was not available before VMS V7.0 and CRTL version V7.0

I have an old Alpha 2100 running VMS V6.2-1H3 that I just noticed has DEC C V5.5. netdb.h is there, so it must have been around when those versions came out.
Steven Schweda
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

> netdb.h was not available before VMS V7.0 and CRTL version V7.0

Well, I don't know about you, but now I plan
to delete those files on my old VAXes the
next chance I get. (I wonder who could have
put them there. Sabotage, that's what it is.)

If I weren't so lazy, I'd fire up the old
VAXstation 2000 with VMS V5.5-2 and the
Wollongong PathWay TCP/IP software installed,
to see what it has. I'd bet that they
supplied a network-capable NETDB.H. I
suppose that I should delete that one, too.
Arch_Muthiah
Honored Contributor

Re: Which version of DEC C or VMS introduced...?

Galen,

> netdb.h was not available before VMS V7.0 and CRTL version V7.0

My info above is incorrect, and thanks for your kind information.

I should have mentioned like "BSD 4.4 Socket package functions are not added in NETDB.H before OpenVMS V7.0"

My dear other friend, Make sure to take a video clip while burn your vax machines to send to "short tempered man computer jokes" web sites.

Thanks
Archunan
Regards
Archie