[comp.os.minix] problems in make, /lib/cpp

rmtodd@uokmax.UUCP (07/11/87)

1.  The MINIX make does not handle makefiles correctly which have macro
substitutions included in macro definitions, e.g.
SRCS2 = foo.c
SRCS = bar.c baz.c $(SRCS2)
I've seen makefiles for software on full UNIX systems use this feature with
no problems, so it must be a fault in the MINIX make.c (not running the line
thru the macro expander or something like that).

2.  A good deal of C software out there uses the "#if defined(word)" 
preprocessor feature.  /lib/cpp doesn't, and the error messages it gives
on encountering it aren't exactly crystal-clear as to their meaning and
cause.

3. An outright bug in /lib/cpp.  Try compiling this program on your MINIX
machine:
-------------
main() {
	printf("foo"");
}
-------------
It does, as you can see, have an unmatched quote.  One would expect an
error message complaining about a quote mismatch.  What one does get is
a stream of error messages about how it expected ')', ';', and '}', which
is at least understandable if you are familiar with how many compilers work.
What isn't understandable is why the C compiler also complains about non-ASCII
characters in the input.  You certainly didn't put any there.  For further
enlightenment, run the program just through cpp, with a command line like:
	/lib/cpp foo.c
and look at the output.  You will see a bunch of non-ASCII garbage dumped
out at the end of the pre-processor output, and it looks like part of the
cpp code itself is getting output.  This is ungood.
(Granted one shouldn't make such stupid mistakes in one's code, but one
doesn't expect the compiler to fail so drastically on bogus input.)
--------------------------------------------------------------------------
Richard Todd
USSnail:820 Annie Court,Norman OK 73069
UUCP: {allegra!cbosgd|ihnp4}!okstate!uokmax!rmtodd

barber@rabbit1.UUCP (Steve Barber) (07/15/87)

In article <623@uokmax.UUCP>, rmtodd@uokmax.UUCP (Richard Michael Todd) writes:
> 2.  A good deal of C software out there uses the "#if defined(word)" 
> preprocessor feature.  /lib/cpp doesn't, and the error messages it gives
> on encountering it aren't exactly crystal-clear as to their meaning and
> cause.
> --------------------------------------------------------------------------
> Richard Todd
> USSnail:820 Annie Court,Norman OK 73069
> UUCP: {allegra!cbosgd|ihnp4}!okstate!uokmax!rmtodd

The V7 cpp did not support the #if defined() syntax.  Since MINIX is
an "emulation" of V7, it is not surprising that this doesn't work.

-- 
Steve Barber    Rabbit Software Corp.
..!seismo!cbmvax!hutch!barber ...!ihnp4!cuuxb!hutch!barber
(215) 647-0440  7 Great Valley Parkway East  Malvern PA 19355