This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/34280] New: using -o with -MM produces truncated output with multiple input files
- From: "vapier at gentoo dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 01:45:54 -0000
- Subject: [Bug driver/34280] New: using -o with -MM produces truncated output with multiple input files
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
trying to do something simple like:
$ gcc -MM one.c two.c three.c -o .depend
results in .depend only containing the information from the last file processed
as each file processed causes the output to be opened/closed with O_TRUNC
$ cat .depend
three.o: three.c
$ strace -f -eopen gcc -MM one.c two.c three.c -o .depend 2>&1 | grep
'\.depend'
28900 open(".depend", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
28901 open(".depend", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
28902 open(".depend", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
a quick compare shows 3.3.6 - 4.3.0 all behaving this way
--
Summary: using -o with -MM produces truncated output with
multiple input files
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: driver
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vapier at gentoo dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34280