bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

make-4.2.93 patch port to c90


From: Dmitry Goncharov
Subject: make-4.2.93 patch port to c90
Date: Fri, 3 Jan 2020 22:21:00 -0500

Good morning.

This patch replaced a c99 piece of code with c90 code.
This c99 piece of code does not compile with the default ./configure && make.
Also, -std=c99 removes __attribute__.

regards, Dmitry


diff --git a/src/file.c b/src/file.c
index 2f1425e..acc8c0c 100644
--- a/src/file.c
+++ b/src/file.c
@@ -641,8 +641,8 @@ struct dep *
 expand_extra_prereqs (const struct variable *extra)
 {
   struct dep *prereqs = extra ? split_prereqs (variable_expand
(extra->value)) : NULL;
-
-  for (struct dep *d = prereqs; d; d = d->next)
+  struct dep *d = prereqs;
+  for (; d; d = d->next)
     {
       d->file = lookup_file (d->name);
       if (!d->file)
diff --git a/src/rule.c b/src/rule.c
index 358ec56..f2e2ac9 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -72,11 +72,13 @@ snap_implicit_rules (void)
   char *name = NULL;
   size_t namelen = 0;
   struct dep *prereqs = expand_extra_prereqs (lookup_variable
(STRING_SIZE_TUPLE(".EXTRA_PREREQS")));
+  struct dep *d = prereqs;
   unsigned int pre_deps = 0;
+  struct rule *rule = pattern_rules;

   max_pattern_dep_length = 0;

-  for (struct dep *d = prereqs; d; d = d->next)
+  for (; d; d = d->next)
     {
       size_t l = strlen (dep_name (d));
       if (l > max_pattern_dep_length)
@@ -86,17 +88,18 @@ snap_implicit_rules (void)

   num_pattern_rules = max_pattern_targets = max_pattern_deps = 0;

-  for (struct rule *rule = pattern_rules; rule; rule = rule->next)
+  for (; rule; rule = rule->next)
     {
       unsigned int ndeps = pre_deps;
       struct dep *lastdep = NULL;
+      struct dep *dep = rule->deps;

       ++num_pattern_rules;

       if (rule->num > max_pattern_targets)
         max_pattern_targets = rule->num;

-      for (struct dep *dep = rule->deps; dep != 0; dep = dep->next)
+      for (; dep != 0; dep = dep->next)
         {
           const char *dname = dep_name (dep);
           size_t len = strlen (dname);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]