[Info-vax] C compiler snag
Craig A. Berry
craigberry at nospam.mac.com
Fri May 21 12:01:14 EDT 2021
On 5/21/21 8:26 AM, John E. Malmberg wrote:
> Depending on the compiler settings, if a directory is present in the
> specification and exists in the source code, then the header will be
> used from that directory instead of the OpenVMS text libraries, except
> if the directory is specified as "..".
>
> The case of ".." is a case where this does not work, and I can not
> reproduce this failure with just test programs on the CRTL, regardless
> of the feature settings.
You seem to have missed my analysis showing that ../ does work but the
question about handling relative paths is relative to what? As far as I
can find, there is no standard and how this is handled is
implementation-defined. Most compilers seem to specify that it's
relative to the file in which the #include directive is found. The VMS
compiler doesn't do that but looks for the header relative to either the
top-level compilation unit or the current working directory from which
the compile command was run. The two were one and the same in the
example originally posted, so it's impossible to know which without
further analysis (or reading the compiler sources, which I don't have).
More information about the Info-vax
mailing list