]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/rule.c (get_rule_defn): Don't use STRING_SIZE_TUPLE in mempcpy
authorPaul Smith <psmith@gnu.org>
Sun, 23 Oct 2022 18:00:08 +0000 (14:00 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 23 Oct 2022 22:41:50 +0000 (18:41 -0400)
If mempcpy() is a macro then STRING_SIZE_TUPLE won't compile.

src/makeint.h
src/rule.c

index e345011b9e80e6ae915779f852d12144f67b73a4..c726abe08e4e9c1c6878bf1a77accaff2108991b 100644 (file)
@@ -495,6 +495,8 @@ extern struct rlimit stack_limit;
 
 /* Number of characters in a string constant.  Does NOT include the \0 byte.  */
 #define CSTRLEN(_s)           (sizeof (_s)-1)
+
+/* Only usable when NOT calling a macro: only use it for local functions.  */
 #define STRING_SIZE_TUPLE(_s) (_s), CSTRLEN(_s)
 
 /* The number of bytes needed to represent the largest signed and unsigned
index a1f9ef32506be5b0c422299ff7a81c6eaaa7b367..0fc64bc87177e0d93b52e87dd67a498a29859e44 100644 (file)
@@ -94,7 +94,7 @@ get_rule_defn (struct rule *r)
         if (dep->ignore_mtime == 0)
           {
             if (dep->wait_here)
-              p = mempcpy (p, STRING_SIZE_TUPLE (" .WAIT"));
+              p = mempcpy (p, " .WAIT", CSTRLEN (" .WAIT"));
             p = mempcpy (mempcpy (p, " ", 1), dep_name (dep),
                          strlen (dep_name (dep)));
           }
@@ -107,7 +107,7 @@ get_rule_defn (struct rule *r)
           {
             p = mempcpy (p, sep, strlen (sep));
             if (ood->wait_here)
-              p = mempcpy (p, STRING_SIZE_TUPLE (".WAIT "));
+              p = mempcpy (p, ".WAIT ", CSTRLEN (".WAIT "));
             p = mempcpy (p, dep_name (ood), strlen (dep_name (ood)));
           }
       *p = '\0';