Due to the differences between the filesystems of Unix and VMS, GNU CC attempts to translate file names in `#include' into names that VMS will understand. The basic strategy is to prepend a prefix to the specification of the include file, convert the whole filename to a VMS filename, and then try to open the file. GNU CC tries various prefixes one by one until one of them succeeds:
Include directives of the form:
#include foobar
are a common source of incompatibility between VAX-C and GNU CC. VAX-C
treats this much like a standard #include <foobar.h>
directive.
That is incompatible with the ANSI C behavior implemented by GNU CC: to
expand the name foobar
as a macro. Macro expansion should
eventually yield one of the two standard formats for #include
:
#include "file" #include <file>
If you have this problem, the best solution is to modify the source to
convert the #include
directives to one of the two standard forms.
That will work with either compiler. If you want a quick and dirty fix,
define the file names as macros with the proper expansion, like this:
#define stdio <stdio.h>
This will work, as long as the name doesn't conflict with anything else in the program.
Another source of incompatibility is that VAX-C assumes that:
#include "foobar"
is actually asking for the file `foobar.h'. GNU CC does not make this assumption, and instead takes what you ask for literally; it tries to read the file `foobar'. The best way to avoid this problem is to always specify the desired file extension in your include directives.
GNU CC for VMS is distributed with a set of include files that is
sufficient to compile most general purpose programs. Even though the
GNU CC distribution does not contain header files to define constants
and structures for some VMS system-specific functions, there is no
reason why you cannot use GNU CC with any of these functions. You first
may have to generate or create header files, either by using the public
domain utility UNSDL
(which can be found on a DECUS tape), or by
extracting the relevant modules from one of the system macro libraries,
and using an editor to construct a C header file.
A #include
file name cannot contain a DECNET node name. The
preprocessor reports an I/O error if you attempt to use a node name,
whether explicitly, or implicitly via a logical name.
Go to the first, previous, next, last section, table of contents.