On 2017-07-20 20:32:12 +0000, John Reagan said:
> On Thursday, July 20, 2017 at 2:08:13 PM UTC-4, Saifi Khan wrote:
>>
>> Could you elaborate, what you mean by "RTLs are missing a few things." ?
>
> The obvious stuff is:
>
> - The C99 header "stdint.h" is missing
> - The C99 header "fenv.h" is missing
> - Various C99 required macros that should be in "inttypes.h" are
> missing (for example, PRIi32)
> - The C99 required "printf/scanf" conversion specifier "F" is missing.
> - The C99 required "printf/scanf" argument types "hh","t","j", and "z"
> are missing
The C run-time library (RTL) is one of a number of RTLs present on OpenVMS.
OpenVMS support for C99 is compiler-only. Put another way, any
header files or C library routines or changes from C99 or later are
missing from the OpenVMS implementation of C. For details, look
around the 'net for discussions of the changes from C90 to C99, and
outside of the changes specific to the compiler and not the include
files and C calls, and you'll have the list of what's not there in C on
OpenVMS. Many of the common C routines found across Unix and Linux
and BSD systems are also missing as distinct from what's part of the C
standards, and this'll be a bigger problem for many applications.
Also missing are many of the common libraries found on Unix, Linux and
BSD, and you'll have to find and install or port those separately
fork()/vfork()/exec() is a topic best avoided. The C socket IP calls
are off in another part of the doc. The current online help for the C
calls is accessible from DCL via the command HELP CRTL. (HELP itself
is rather limited, but that's another discussion.)
Large discussion of the various missing C routines in past postings
here in the comp.os.vms newsgroup; check the Gargle Groups archives for
the newsgroup for details.
Also missing compiler-built-ins for dealing with descriptors — you're
going to need to get familiar with those and with itemlists, when
calling OpenVMS services — and other OpenVMS-isms. Those are handled
via include files, descrip.h or maybe dscdef.h, depending on what
you're doing. (Not by the compiler, as might be expected.
Descriptors are a completely separate means of accessing strings
specific to OpenVMS, and are distinct from the null-terminated C
strings you're likely familiar with.)
The C includes are divided into several hunks: those specific to C, and
those that are specific to OpenVMS. The latter are further split into
those that are stable or documented (and they're in SYS$STARLET_C.TLB)
and those that are less documented or are unstable (SYS$LIB_C.TLB),
If you're working on traditional C code and not using any system
services or kernel calls or OpenVMS RTL calls, you won't need the
latter stuff.
C include files are buried in text libraries, The contents of these
include files are retrieved from TLB files stored in the SYS$LIBRARY:
directory by the compiler. You might find one of the old and
usually-stale header file include reference directories
SYS$SYSROOT:[DECC$LIB...] on a server you're working with, and that can
be useful to look in and to SEARCH through, but it's not maintained by
the C kits (anymore) and it's not used by default by the compiler, so
the contents can be stale.
Eight-cubed.com has been mentioned, and that's a good resource for
examples of system service and RTL calls. Other resources include
digiater.nl and
decuslib.com, as well as the OpenVMS archives at
Process software
process.com site. Various stuff posted at HPE and at
the HPE Freeware site tends to be stale. SYS$EXAMPLES is a great way
to learn how our ancestors once coded C. The notes conferences — DCL
command is NOTES — available over at decuserve also have some
information, and the porting-related notes conference (porting_to_vms,
IIRC) hosted over there might be interesting to you.
There are other wrinkles.
In short: there's very little documentation available on the
differences from other environments. (The oft-fondly-remembered
OpenVMS documentation hosted at HPE is unfortunately somewhat lacking
in this and other areas, but it's also what is available at your
budget. The VSI folks will likely eventually address parts of this,
both with newer versions of C for x86-64 and with newer documentation
for OpenVMS and layered products.)
--
Pure Personal Opinion | HoffmanLabs LLC