Bug in DEPENDENCIES_OUTPUT support (2.7.2, egcs 1.0.2)

Zack Weinberg zack@rabi.phys.columbia.edu
Sun Apr 12 17:22:00 GMT 1998

On both gcc 2.7.2 and egcs 1.0.2, DEPENDENCIES_OUTPUT does not work
correctly.  One would expect it to write a file with identical
contents to that generated by the -M switch.  Instead, if no target is
specified the file gives only a dependency on the .c file, and if a
target is specified it gives no dependencies at all.

Here's an example:

$ cat tst.c
#include <stddef.h>  /* this header includes no other headers */
$ gcc -M tst.c
tst.o: tst.c \
$ DEPENDENCIES_OUTPUT=file gcc -E tst.c >/dev/null; cat file
tst.o: tst.c
$ rm file
$ DEPENDENCIES_OUTPUT='file x' gcc -E tst.c >/dev/null; cat file
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.27/specs
gcc version egcs-2.90.27 980315 (egcs-1.0.2 release)

2.7.2 behaves identically.

Also, if the file already exists it is appended to.  It would, IMO, be
better if it were replaced.


More information about the Gcc-bugs mailing list