[gnu.gcc.bug] gcc-cpp from SUNPRO make discards output

paul@UUNET.UU.NET (Paul Hudson) (02/14/89)

Although the new gcc-ccp works with the SUNPRO make in the sense of
writing the dependencies to a file, it appears it neglects to write
the pre-processed output!

The reason is that "printdeps" is used as a flag for this and for -M.
Although there is another flag inhibit_output, it isn't even examined if
printdeps is non-zero - see the code fragment from cccp.c included here.


  if (dump_macros)
    dump_all_macros ();
  else if (print_deps) {
    fputs (deps_buffer, deps_stream);
    putc ('\n', deps_stream);
    if (deps_stream != stdout) {
      fclose (deps_stream);
      if (ferror (deps_stream))
	fatal ("I/O error on output");
    }
  } else if (! inhibit_output) {
    if (write (fileno (stdout), outbuf.buf, outbuf.bufp - outbuf.buf) < 0)
      fatal ("I/O error on output");
  }

This was a very confusing bug - the identical command line executed outside
of make worked, of course, because the appropiate enviroment variables
weren't set. Just shows what a bad design decision sun made when adding
this feature.

Paul Hudson 

Snail mail: Monotype ADG	Email:	...!ukc!acorn!moncam!paul
	    Science Park,		paul@moncam.co.uk
	    Milton Road,	"Sun Microsysytems:
	    Cambridge,		 The Company is Arrogant (TM)"
	    CB4 4FQ