[7136] in Athena Bugs
vax 7.2Q: saber and xsaber
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Tue Feb 19 17:39:54 1991
Date: Tue, 19 Feb 91 17:39:39 -0500
From: "Jonathan I. Kamens" <jik@pit-manager.MIT.EDU>
To: lnp@ATHENA.MIT.EDU
Cc: bugs@ATHENA.MIT.EDU
In-Reply-To: bugs[7053]
The problem you describe in the message included below is not due to
a bug in saber; it is due to the fact that you are loading the include
files incorrectly.
The load command, according to "help load" inside saber, is used to
"load source, object or library file". Using "load" inside saber is
equivalent (in scope) to running the compiler on one source file to
produce one object file outside of saber.
One result of this is that typedefs in a file that you "load" do not
last after the load has completed, just as typedefs in a C source file
last only as long as the compiler is working on one .c file.
If you want to load include files into the saber workspace and have
the typedefs and such in the file continue to work after the load is
completed, you should use "#include" directly from the workspace, for
example:
2 -> #include <string.h>
Jonathan Kamens
Project Athena Quality Assurance
Reference:
Date: Wed, 06 Feb 91 12:22:29 EST
From: Lisa N. Paradis <lnp@ATHENA.MIT.EDU>
System name: tabetha
Type and version: CVAXSTAR 7.2Q (1 update(s) to same version)
Display type: SM
What were you trying to do?
run saber on my program (/mit/lnp/project/techinfo/tech.c)
What's wrong:
Since the program deals with network stuff, the following is
the list of includes in tech.c
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/file.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
Well, I tried to load these into saber and xsaber and I had problems
with an "illegal declaration of u_long" in /usr/include/sys/socket.h
This happened AFTER I loaded /usr/include/sys/types.h
The following is what happened while I was running saber:
2 -> load /usr/include/string.h
Loading: /usr/include/string.h
3 -> load /usr/include/ctype.h
Loading: /usr/include/ctype.h
4 -> load /usr/include/errno.h
Loading: /usr/include/errno.h
5 -> load /usr/include/sys/types.h
Loading: /usr/include/sys/types.h
6 -> load /usr/include/sys/file.h
Loading: /usr/include/sys/file.h
7 -> load /usr/include/sys/socket.h
Loading: /usr/include/sys/socket.h
----------------
"/usr/include/sys/socket.h":95, Declaration syntax (Error #243)
94: struct sockaddr {
95: u_short sa_family; /* address family */
^
96: char sa_data[14]; /* up to 14 bytes of direct address */
Illegal declaration syntax near 'u_short'.
The module has not been modified. Continuing loading...
Unloading: /usr/include/sys/socket.h
8 -> load /usr/include/netinet/in.h
Loading: /usr/include/netinet/in.h
----------------
"/usr/include/netinet/in.h":66, Declaration syntax (Error #243)
65: struct in_addr {
66: u_long s_addr;
^
67: };
Illegal declaration syntax near 'u_long'.
Unloading: /usr/include/netinet/in.h
9 -> q
Unknown command `q'.
10 -> quit
What should have happened:
It should have loaded socket.h and in.h without any problems.
I doubt that the problem lies in socket.h since so many
programs depend on it and those programs work.
Please describe any relevant documentation references:
/usr/include/sys/types.h, /usr/include/sys/socket.h
saber, xsaber man pages