From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27060 invoked by alias); 30 Jan 2003 21:46:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 27035 invoked by uid 71); 30 Jan 2003 21:46:01 -0000 Resent-Date: 30 Jan 2003 21:46:01 -0000 Resent-Message-ID: <20030130214601.27033.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, Ralf.Friedl@online.de Received: (qmail 26753 invoked by uid 48); 30 Jan 2003 21:45:18 -0000 Message-Id: <20030130214518.26752.qmail@sources.redhat.com> Date: Thu, 30 Jan 2003 21:46:00 -0000 From: Ralf.Friedl@online.de Reply-To: Ralf.Friedl@online.de To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: driver/9517: makefile dependencies deleted on error, option -MMD X-SW-Source: 2003-01/txt/msg01743.txt.bz2 List-Id: >Number: 9517 >Category: driver >Synopsis: makefile dependencies deleted on error, option -MMD >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: change-request >Submitter-Id: net >Arrival-Date: Thu Jan 30 21:46:01 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Ralf.Friedl@online.de >Release: gcc-3.2 >Organization: >Environment: >Description: The Option -MMD can be used to create dependency files for inclusion in 'make'. If 'make' is used with these files, the following problem occurs: If compilation fails, the dependency file is removed, but the object file is not removed. If the compilation fails because of errors in included files, the demendancy information is lost. When in the included file is changed (to fix the error), 'make' will no longer know about the dependancies and not recompile the object file. As the object files are still present, it is possible that an executable is created from the old objects without indication to the user. >How-To-Repeat: Create foo.c, foo.h Makefile: CPPFLAGS = -MMD foo: foo.o include $(wildcard *.d) Run 'make', this create foo.o and foo.d. Change foo.h to contain an error. Run make, this deletes foo.d but keeps foo.o. Change foo.h again (fix error) Run 'make', it does nothing because foo.o exists and is newer than foo.c, and foo.d does not exists, so the dependency on foo.h is unknown. >Fix: delete object file, where compilation fails or keep dependancy file As the dependancy file is created by the preprocessor, it should not be affected by compiler errors. >Release-Note: >Audit-Trail: >Unformatted: