Hi,
In file implicit.c, there seems to be a variable 'remove_explicit_deps'
which, as far as I can tell, serves as a flag to "remove all the
dependencies that didn't come from this implicit rule", as per the
comment in the code.
However, this variable is initialized to 0, then set to 0, then checked
in an if statement, which implies this value is a compile time only
flag. Since this code can never be reached, it seems logical to remove
it; (or if it should exist, at least make it a #define.
Below is a patch which removes this "dead code", which was found by
Coverity.
Thanks,
Mike
---
--- make-3.81/implicit.c 2006-04-01 00:36:40.000000000 -0600
+++ make-3.81-diff/implicit.c 2006-04-26 09:23:23.801794184 -0500
@@ -219,9 +219,6 @@
(see struct idep for details). */
struct idep* deps = 0;
- /* 1 if we need to remove explicit prerequisites, 0 otherwise. */
- unsigned int remove_explicit_deps = 0;
-
/* Names of possible dependencies are constructed in this buffer. */
register char *depname = (char *) alloca (namelen +
max_pattern_dep_length);
@@ -445,8 +442,6 @@
rule = tryrules[i];
- remove_explicit_deps = 0;
-
/* RULE is nil when we discover that a rule,
already placed in TRYRULES, should not be applied. */
if (rule == 0)
@@ -802,21 +797,6 @@
This includes the intermediate files, if any.
Convert them into entries on the deps-chain of FILE. */
- if (remove_explicit_deps)
- {
- /* Remove all the dependencies that didn't come from
- this implicit rule. */
-
- dep = file->deps;
- while (dep != 0)
- {
- struct dep *next = dep->next;
- free_dep (dep);
- dep = next;
- }
- file->deps = 0;
- }
-
expl_d = file->deps; /* We will add them at the end. */
d_ptr = &file->deps;
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make