Compiler without defines

John R. MacMillan john at chance.UUCP
Fri Mar 29 01:31:35 AEST 1991


|Suddenly, my compiler can onnly locate the pre-defined symbol unix.
|MC68000, SysV, etc have disappeared.

I presume you mean the cpp (preprocessor) symbols?  /lib/cpp defines
unix, and mc68k (and __LINE__ and __FILE__); if you run strings on
/lib/cpp, you should see these.  /bin/cc by default defines mc68k32,
mc68k and mc68010 when it invokes cpp; you can see this by trying
"/bin/cc -# -E foo.c".  SysV is usually defined in the Makefile of
whatever you're trying to build, although SYSV is unconditionally
defined in /usr/include/curses.h (enough to my annoyance that it is no
longer true on chance).

If you mean symbols that should be resolved by ld, then I'm afraid I'm
not sure what you mean.

|I looked at my libraries and noticed that they had been changed at about the
|same time as the combo board and its driver were installed.

The Install.sh script moves libc.a, libm.a, libmath.a, ifile.0413,
crt0.o and ld out of the way when it does installs, so that's why the
date changes. (This makes it difficult to install library upgrades,
and is one reason I install things ``manually'' by running the
package's Install script after I've looked it over to see what it
wants to do.)

One preprocessor symbol you might notice missing if you run lint, is
the symbol ``lint''!  This is because of what is IMHO a bug in
/bin/cc.  If you do a strings on /bin/cc, you'll notice the getopt
string, and in it "C:", ie. the -C flag takes an argument.  Well, the
-C flag to cpp does NOT take an argument, and when lint invokes cc it
does not supply an argument.  So the argument after, which happens to
be ``-Dlint'', disappears.  Two fixes: change lint to put a bogus
argument after -C, or patch the binary of /bin/cc.



More information about the Comp.sys.3b1 mailing list