Operating System - OpenVMS
1748257 Members
3965 Online
108760 Solutions
New Discussion юеВ

Re: 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 14
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