public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/14934] New: the assumed dependency target isn't always right
@ 2004-04-13  4:24 dfries at mail dot win dot org
  2004-04-13  8:23 ` [Bug preprocessor/14934] " pinskia at gcc dot gnu dot org
  2004-04-13 10:10 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: dfries at mail dot win dot org @ 2004-04-13  4:24 UTC (permalink / raw)
  To: gcc-bugs

SpacedOut:/tmp/test$ gcc -MMD headers.h
SpacedOut:/tmp/test$ cat headers.d 
headers.o: headers.h
SpacedOut:/tmp/test$ gcc -MMD main.c
SpacedOut:/tmp/test$ cat main.d
main.o: main.c

The correct output would be,
headers.h.gch: headers.h
a.out: main.c headers.h.gch

While a.out might be arguable strace
strace -o /tmp/gcc_output -e file -f -F gcc -MMD main.c
shows that main.o was never created so it really can't be the right
target file.

The function deps_add_default_target in gcc/mkdeps.c adds .o to the
basename of whatever file that is being compiled.  Perhaps the section
of the compiler that generates the final output file should be where
the target is specified.

SpacedOut:/tmp/test$ gcc -v
Reading specs from /home/david/WorkProjects/OpenSceneGraph/DevelGcc/install/lib/gcc/i686-pc-linux-gnu/3.5.0/specs
Configured with: ../gcc_src/configure --enable-languages=c++ --prefix=/home/david/WorkProjects/OpenSceneGraph/DevelGcc/install 
--exec-prefix=/home/david/WorkProjects/OpenSceneGraph/DevelGcc/install
Thread model: posix
gcc version 3.5.0 20040412 (experimental)


header.h:
#ifndef _HEADERS_H
#define _HEADERS_H 1
const int value=32;
#endif /* _HEADERS_H */

main.c:
#include "headers.h"

int main(int argc, char ** argv)
{
        return value;
}

-- 
           Summary: the assumed dependency target isn't always right
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dfries at mail dot win dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-linux
  GCC host triplet: i386-linux
GCC target triplet: i386-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14934


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-04-13  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13  4:24 [Bug c/14934] New: the assumed dependency target isn't always right dfries at mail dot win dot org
2004-04-13  8:23 ` [Bug preprocessor/14934] " pinskia at gcc dot gnu dot org
2004-04-13 10:10 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).