[Info-vax] net: device (Re: C compiler snag)

Simon Clubley clubley at remove_me.eisner.decus.org-Earth.UFP
Fri May 21 17:13:27 EDT 2021


On 2021-05-21, Craig A. Berry <craigberry at nospam.mac.com> wrote:
> On 5/21/21 12:42 PM, Simon Clubley wrote:
>> There is a problem when you use net/
>> within an include statement. The following code compiles: !!!
>> 
>> ---------------------------------------------------------------------------
>> $ type nettest.c
>> #include <stdio.h>
>> #include <net/does_not_exist.h>
>> 
>> int main(int argc, char *argv[])
>>          {
>>          printf("Testing net include\n");
>>          return 0;
>>          }
>> $ cc nettest.c
>> ---------------------------------------------------------------------------
>
> Bug or feature I don't know, but again it seems to have nothing to do
> with the compiler.  Opening a non-existent file on the net: device
> returns success.  What you expect from opening a non-existent file:
>

I'm not so sure. Based on what has been said so far, I think this
is a compiler specific problem.

I think John Malmberg is right and that the compiler is wrongly
looking for a device (NET:) with the name of the net/ include directory
and using that instead of looking for a [.net] directory.

>
> So the compiler is just converting net/does_not_exist.h to VMS syntax
> net:does_not_exist.h and getting a successful open but nothing happens
> when you read from it (except EOF I guess).  The filename portion
> doesn't matter and seems to be ignored.  As far as I can tell, the
> behavior is identical to that of _NLA0:.
>

That's my understanding as well. What it should be doing instead is
looking for [.net]does_not_exist.h and then reporting an error when
it doesn't find the file in that location.

Simon.

-- 
Simon Clubley, clubley at remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.



More information about the Info-vax mailing list