Imported Upstream version 3.7.1 upstream/3.7.1
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:28:26 +0000 (16:28 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:28:26 +0000 (16:28 +0900)
20 files changed:
LICENSE.adoc
LICENSE.html
README.md
doc/AUTHORS.adoc
doc/AUTHORS.html
doc/MANUAL.html
doc/NEWS.adoc
doc/NEWS.html
doc/ccache.1
src/ccache.c
src/ccache.h
src/conf.c
src/execute.c
src/hashutil.c
src/stats.c
src/version.c
test/suites/depend.bash
test/suites/direct.bash
test/suites/direct_gcc.bash
unittest/framework.c

index 30848f4..e10ae20 100644 (file)
@@ -420,30 +420,6 @@ This fast hash implementation is released to the public domain by Austin
 Appleby. See http://murmurhash.googlepages.com.
 
 
-src/snprintf.c and m4/snprintf.m4
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-This implementation of `snprintf()` and similar functions was downloaded from
-http://www.jhweiss.de/software/snprintf.html and has the following license:
-
--------------------------------------------------------------------------------
-  Copyright (c) 1995 Patrick Powell.
-
-  This code is based on code written by Patrick Powell <papowell@astart.com>.
-  It may be used for any purpose as long as this notice remains intact on all
-  source code distributions.
-
-  Copyright (c) 2008 Holger Weiss.
-
-  This version of the code is maintained by Holger Weiss <holger@jhweiss.de>.
-  My changes to the code may freely be used, modified and/or redistributed for
-  any purpose. It would be nice if additions and fixes to this file (including
-  trivial code cleanups) would be sent back in order to let me include them in
-  the version available at <http://www.jhweiss.de/software/snprintf.html>.
-  However, this is not a requirement for using or redistributing (possibly
-  modified) versions of this file, nor is leaving this notice intact mandatory.
--------------------------------------------------------------------------------
-
 src/minitrace.[hc]
 ~~~~~~~~~~~~~~~~~~
 
@@ -474,6 +450,30 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 SOFTWARE.
 -------------------------------------------------------------------------------
 
+src/snprintf.c and m4/snprintf.m4
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This implementation of `snprintf()` and similar functions was downloaded from
+http://www.jhweiss.de/software/snprintf.html and has the following license:
+
+-------------------------------------------------------------------------------
+  Copyright (c) 1995 Patrick Powell.
+
+  This code is based on code written by Patrick Powell <papowell@astart.com>.
+  It may be used for any purpose as long as this notice remains intact on all
+  source code distributions.
+
+  Copyright (c) 2008 Holger Weiss.
+
+  This version of the code is maintained by Holger Weiss <holger@jhweiss.de>.
+  My changes to the code may freely be used, modified and/or redistributed for
+  any purpose. It would be nice if additions and fixes to this file (including
+  trivial code cleanups) would be sent back in order to let me include them in
+  the version available at <http://www.jhweiss.de/software/snprintf.html>.
+  However, this is not a requirement for using or redistributing (possibly
+  modified) versions of this file, nor is leaving this notice intact mandatory.
+-------------------------------------------------------------------------------
+
 src/zlib/*.[hc]
 ~~~~~~~~~~~~~~~
 
index 1de702f..35edf7d 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.7</span>\r
+<span id="revnumber">version 3.7.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -1150,29 +1150,6 @@ following license:</p></div>
 Appleby. See <a href="http://murmurhash.googlepages.com">http://murmurhash.googlepages.com</a>.</p></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_src_snprintf_c_and_m4_snprintf_m4">src/snprintf.c and m4/snprintf.m4</h3>\r
-<div class="paragraph"><p>This implementation of <code>snprintf()</code> and similar functions was downloaded from\r
-<a href="http://www.jhweiss.de/software/snprintf.html">http://www.jhweiss.de/software/snprintf.html</a> and has the following license:</p></div>\r
-<div class="listingblock">\r
-<div class="content">\r
-<pre><code>  Copyright (c) 1995 Patrick Powell.\r
-\r
-  This code is based on code written by Patrick Powell &lt;papowell@astart.com&gt;.\r
-  It may be used for any purpose as long as this notice remains intact on all\r
-  source code distributions.\r
-\r
-  Copyright (c) 2008 Holger Weiss.\r
-\r
-  This version of the code is maintained by Holger Weiss &lt;holger@jhweiss.de&gt;.\r
-  My changes to the code may freely be used, modified and/or redistributed for\r
-  any purpose. It would be nice if additions and fixes to this file (including\r
-  trivial code cleanups) would be sent back in order to let me include them in\r
-  the version available at &lt;http://www.jhweiss.de/software/snprintf.html&gt;.\r
-  However, this is not a requirement for using or redistributing (possibly\r
-  modified) versions of this file, nor is leaving this notice intact mandatory.</code></pre>\r
-</div></div>\r
-</div>\r
-<div class="sect2">\r
 <h3 id="_src_minitrace_hc">src/minitrace.[hc]</h3>\r
 <div class="paragraph"><p>A library for producing JSON traces suitable for Chrome&#8217;s built-in trace viewer\r
 (chrome://tracing). Downloaded from <a href="https://github.com/hrydgard/minitrace">https://github.com/hrydgard/minitrace</a>.</p></div>\r
@@ -1202,6 +1179,29 @@ SOFTWARE.</code></pre>
 </div></div>\r
 </div>\r
 <div class="sect2">\r
+<h3 id="_src_snprintf_c_and_m4_snprintf_m4">src/snprintf.c and m4/snprintf.m4</h3>\r
+<div class="paragraph"><p>This implementation of <code>snprintf()</code> and similar functions was downloaded from\r
+<a href="http://www.jhweiss.de/software/snprintf.html">http://www.jhweiss.de/software/snprintf.html</a> and has the following license:</p></div>\r
+<div class="listingblock">\r
+<div class="content">\r
+<pre><code>  Copyright (c) 1995 Patrick Powell.\r
+\r
+  This code is based on code written by Patrick Powell &lt;papowell@astart.com&gt;.\r
+  It may be used for any purpose as long as this notice remains intact on all\r
+  source code distributions.\r
+\r
+  Copyright (c) 2008 Holger Weiss.\r
+\r
+  This version of the code is maintained by Holger Weiss &lt;holger@jhweiss.de&gt;.\r
+  My changes to the code may freely be used, modified and/or redistributed for\r
+  any purpose. It would be nice if additions and fixes to this file (including\r
+  trivial code cleanups) would be sent back in order to let me include them in\r
+  the version available at &lt;http://www.jhweiss.de/software/snprintf.html&gt;.\r
+  However, this is not a requirement for using or redistributing (possibly\r
+  modified) versions of this file, nor is leaving this notice intact mandatory.</code></pre>\r
+</div></div>\r
+</div>\r
+<div class="sect2">\r
 <h3 id="_src_zlib_hc">src/zlib/*.[hc]</h3>\r
 <div class="paragraph"><p>This is a bundled subset of zlib 1.2.11 from <a href="http://zlib.net">http://zlib.net</a> with the\r
 following license:</p></div>\r
@@ -1235,9 +1235,9 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7<br />\r
+Version 3.7.1<br />\r
 Last updated\r
- 2019-04-23 21:35:11 CEST\r
+ 2019-05-01 16:28:03 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 58f8a4d..c88bb21 100644 (file)
--- a/README.md
+++ b/README.md
@@ -31,5 +31,5 @@ Contributing to ccache
 * [Mailing list](https://lists.samba.org/mailman/listinfo/ccache/)
 * [Bug report info](https://ccache.dev/bugs.html)
 * [Issue tracker](https://github.com/ccache/ccache/issues)
-  * [Help wanted!](https://github.com/ccache/ccache/issues/help%20wanted)
-  * [Good first issues!](https://github.com/ccache/ccache/issues/good%20first%20issue)
+  * [Help wanted!](https://github.com/ccache/ccache/labels/help%20wanted)
+  * [Good first issues!](https://github.com/ccache/ccache/labels/good%20first%20issue)
index ab8d39d..e3ca5f6 100644 (file)
@@ -47,6 +47,7 @@ ccache is a collective work with contributions from many people, including:
 * Lalit Chhabra
 * Lars Gustäbel
 * Leanid Chaika
+* Loïc Yhuel
 * Luboš Luňák
 * Maarten Maathuis
 * Mark Starovoytov
@@ -59,6 +60,7 @@ ccache is a collective work with contributions from many people, including:
 * Michael Meeks
 * Michał Mirosław
 * Mihai Serban
+* Mike Blumenkrantz
 * Mike Frysinger
 * Mike Gulick
 * Mikhail Kolomeytsev
index aa15ee8..ae849ab 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.7</span>\r
+<span id="revnumber">version 3.7.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -955,6 +955,11 @@ Leanid Chaika
 </li>\r
 <li>\r
 <p>\r
+Loïc Yhuel\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Luboš Luňák\r
 </p>\r
 </li>\r
@@ -1015,6 +1020,11 @@ Mihai Serban
 </li>\r
 <li>\r
 <p>\r
+Mike Blumenkrantz\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Mike Frysinger\r
 </p>\r
 </li>\r
@@ -1221,9 +1231,9 @@ Yvan Janssens
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7<br />\r
+Version 3.7.1<br />\r
 Last updated\r
- 2019-04-23 21:35:11 CEST\r
+ 2019-05-01 16:28:03 CEST\r
 </div>\r
 </div>\r
 </body>\r
index b25e3c7..5782f21 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.7</span>\r
+<span id="revnumber">version 3.7.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -2736,9 +2736,9 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7<br />\r
+Version 3.7.1<br />\r
 Last updated\r
- 2019-04-23 21:35:11 CEST\r
+ 2019-05-01 16:28:03 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 0a1a17c..10b9dd7 100644 (file)
@@ -1,6 +1,22 @@
 ccache news
 ===========
 
+ccache 3.7.1
+------------
+Release date: 2019-05-01
+
+Changes
+~~~~~~~
+
+- Fixed a problem when using the compiler option `-MF /dev/null`.
+
+- Long commandlines are now handled gracefully on Windows by using the `@file`
+  syntax to avoid hitting the commandline size limit.
+
+- Fixed complaint from GCC 9’s `-Werror=format-overflow` when compiling ccache
+  itself.
+
+
 ccache 3.7
 ----------
 Release date: 2019-04-23
index 94d41b4..57e489c 100644 (file)
@@ -735,7 +735,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.7</span>\r
+<span id="revnumber">version 3.7.1</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -743,11 +743,39 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_7_1">ccache 3.7.1</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2019-05-01</p></div>\r
+<div class="sect2">\r
+<h3 id="_changes">Changes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed a problem when using the compiler option <code>-MF /dev/null</code>.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Long commandlines are now handled gracefully on Windows by using the <code>@file</code>\r
+  syntax to avoid hitting the commandline size limit.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed complaint from GCC 9’s <code>-Werror=format-overflow</code> when compiling ccache\r
+  itself.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_7">ccache 3.7</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-04-23</p></div>\r
 <div class="sect2">\r
-<h3 id="_changes">Changes</h3>\r
+<h3 id="_changes_2">Changes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -899,7 +927,7 @@ Removed support for Fortran 77 again. Some Fortran support was added in
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-01-14</p></div>\r
 <div class="sect2">\r
-<h3 id="_changes_2">Changes</h3>\r
+<h3 id="_changes_3">Changes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -983,7 +1011,7 @@ The algorithm that scans for <code>__DATE_</code> and <code>__TIME__</code> toke
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2019-01-02</p></div>\r
 <div class="sect2">\r
-<h3 id="_changes_3">Changes</h3>\r
+<h3 id="_changes_4">Changes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1014,7 +1042,7 @@ Improved development mode build flags.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2018-10-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_changes_4">Changes</h3>\r
+<h3 id="_changes_5">Changes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -3395,9 +3423,9 @@ Statistics counters are now correctly updated for -E option failures and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.7<br />\r
+Version 3.7.1<br />\r
 Last updated\r
- 2019-04-23 21:35:11 CEST\r
+ 2019-05-01 16:28:03 CEST\r
 </div>\r
 </div>\r
 </body>\r
index c2b56cd..9322785 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
-.\"      Date: 04/23/2019
+.\"      Date: 05/01/2019
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.7
+.\"    Source: ccache 3.7.1
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "04/23/2019" "ccache 3\&.7" "ccache Manual"
+.TH "CCACHE" "1" "05/01/2019" "ccache 3\&.7\&.1" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index ca52495..251783a 100644 (file)
@@ -1519,7 +1519,10 @@ to_cache(struct args *args, struct hash *depend_mode_hash)
                update_cached_result_globals(object_hash);
        }
 
-       if (generating_dependencies) {
+       bool produce_dep_file =
+               generating_dependencies && !str_eq(output_dep, "/dev/null");
+
+       if (produce_dep_file) {
                use_relative_paths_in_depfile(output_dep);
        }
 
@@ -1555,7 +1558,7 @@ to_cache(struct args *args, struct hash *depend_mode_hash)
        MTR_BEGIN("file", "file_put");
 
        copy_file_to_cache(output_obj, cached_obj);
-       if (generating_dependencies) {
+       if (produce_dep_file) {
                copy_file_to_cache(output_dep, cached_dep);
        }
        if (generating_coverage) {
@@ -2040,10 +2043,12 @@ calculate_object_hash(struct args *args, struct hash *hash, int direct_mode)
                                hash_delimiter(hash, "arg");
                                hash_string_buffer(hash, args->argv[i], 3);
 
-                               bool separate_argument = (strlen(args->argv[i]) == 3);
-                               if (separate_argument) {
-                                       // Next argument is dependency name, so skip it.
-                                       i++;
+                               if (!str_eq(output_dep, "/dev/null")) {
+                                       bool separate_argument = (strlen(args->argv[i]) == 3);
+                                       if (separate_argument) {
+                                               // Next argument is dependency name, so skip it.
+                                               i++;
+                                       }
                                }
                                continue;
                        }
@@ -2104,6 +2109,12 @@ calculate_object_hash(struct args *args, struct hash *hash, int direct_mode)
                }
        }
 
+       // Make results with dependency file /dev/null different from those without
+       // it.
+       if (generating_dependencies && str_eq(output_dep, "/dev/null")) {
+               hash_delimiter(hash, "/dev/null dependency file");
+       }
+
        if (!found_ccbin && str_eq(actual_language, "cuda")) {
                hash_nvcc_host_compiler(hash, NULL, NULL);
        }
@@ -2220,7 +2231,10 @@ calculate_object_hash(struct args *args, struct hash *hash, int direct_mode)
                        args_pop(args, 1);
                }
                if (generating_dependencies) {
-                       cc_log("Preprocessor created %s", output_dep);
+                       // Nothing is actually created with -MF /dev/null
+                       if (!str_eq(output_dep, "/dev/null")) {
+                               cc_log("Preprocessor created %s", output_dep);
+                       }
                }
        }
 
@@ -2268,7 +2282,8 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest)
 
        // (If mode != FROMCACHE_DIRECT_MODE, the dependency file is created by gcc.)
        bool produce_dep_file =
-               generating_dependencies && mode == FROMCACHE_DIRECT_MODE;
+               generating_dependencies && mode == FROMCACHE_DIRECT_MODE
+               && !str_eq(output_dep, "/dev/null");
 
        MTR_BEGIN("file", "file_get");
 
@@ -2972,7 +2987,7 @@ cc_process_args(struct args *args, struct args **preprocessor_args,
                                        result = false;
                                        goto out;
                                } else if (arg_profile_dir) {
-                                       cc_log("Setting profile directory to %s", profile_dir);
+                                       cc_log("Setting profile directory to %s", arg_profile_dir);
                                        profile_dir = x_strdup(arg_profile_dir);
                                }
                                continue;
@@ -3837,7 +3852,8 @@ ccache(int argc, char *argv[])
        MTR_END("main", "process_args");
 
        if (conf->depend_mode
-           && (!generating_dependencies || !conf->run_second_cpp || conf->unify)) {
+           && (!generating_dependencies || str_eq(output_dep, "/dev/null")
+               || !conf->run_second_cpp || conf->unify)) {
                cc_log("Disabling depend mode");
                conf->depend_mode = false;
        }
index 39e4b0c..66a9845 100644 (file)
@@ -289,7 +289,7 @@ typedef int (*COMPAR_FN_T)(const void *, const void *);
 #endif
 
 #ifdef _WIN32
-char *win32argvtos(char *prefix, char **argv);
+char *win32argvtos(char *prefix, char **argv, int *length);
 char *win32getshell(char *path);
 int win32execute(char *path, char **argv, int doreturn,
                  int fd_stdout, int fd_stderr);
index 61e4a4b..0e76863 100644 (file)
@@ -80,7 +80,7 @@ out:
 static bool
 parse_line(const char *line, char **key, char **value, char **errmsg)
 {
-#define SKIP_WS(x) while (isspace(*x)) { ++x; }
+#define SKIP_WS(x) do { while (isspace(*x)) { ++x; } } while (false)
 
        *key = NULL;
        *value = NULL;
index ca72d27..4ec3a0a 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2011-2018 Joel Rosdahl
+// Copyright (C) 2011-2019 Joel Rosdahl
 //
 // This program is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by the Free
@@ -26,7 +26,7 @@ find_executable_in_path(const char *name, const char *exclude_name, char *path);
 // Re-create a win32 command line string based on **argv.
 // http://msdn.microsoft.com/en-us/library/17w5ykft.aspx
 char *
-win32argvtos(char *prefix, char **argv)
+win32argvtos(char *prefix, char **argv, int *length)
 {
        int i = 0;
        int k = 0;
@@ -52,6 +52,7 @@ win32argvtos(char *prefix, char **argv)
        char *ptr = malloc(k + 1);
        char *str = ptr;
        if (!str) {
+               *length = 0;
                return NULL;
        }
 
@@ -83,6 +84,7 @@ win32argvtos(char *prefix, char **argv)
        } while ((arg = argv[i++]));
        ptr[-1] = '\0';
 
+       *length = ptr - str - 1;
        return str;
 }
 
@@ -162,13 +164,31 @@ win32execute(char *path, char **argv, int doreturn,
                }
        }
 
-       char *args = win32argvtos(sh, argv);
+       int length;
+       char *args = win32argvtos(sh, argv, &length);
        const char *ext = strrchr(path, '.');
        char full_path_win_ext[MAX_PATH] = {0};
        add_exe_ext_if_no_to_fullpath(full_path_win_ext, MAX_PATH, ext, path);
-       BOOL ret =
-               CreateProcess(full_path_win_ext, args, NULL, NULL, 1, 0, NULL, NULL,
-                             &si, &pi);
+       BOOL ret = FALSE;
+       if (length > 8192) {
+               char *tmp_file = format("%s.tmp", path);
+               FILE *fp = create_tmp_file(&tmp_file, "w");
+               char atfile[MAX_PATH + 3];
+               fwrite(args, 1, length, fp);
+               if (ferror(fp)) {
+                       cc_log("Error writing @file; this command will probably fail: %s", args);
+               }
+               fclose(fp);
+               snprintf(atfile, sizeof(atfile), "\"@%s\"", tmp_file);
+               ret = CreateProcess(NULL, atfile, NULL, NULL, 1, 0, NULL, NULL,
+                                   &si, &pi);
+               tmp_unlink(tmp_file);
+               free(tmp_file);
+       }
+       if (!ret) {
+               ret = CreateProcess(full_path_win_ext, args, NULL, NULL, 1, 0, NULL, NULL,
+                                   &si, &pi);
+       }
        if (fd_stdout != -1) {
                close(fd_stdout);
                close(fd_stderr);
index 289ba17..edf446c 100644 (file)
@@ -212,7 +212,8 @@ hash_command_output(struct hash *hash, const char *command,
 
        char *win32args;
        if (!cmd) {
-               win32args = win32argvtos(sh, args->argv);
+               int length;
+               win32args = win32argvtos(sh, args->argv, &length);
        } else {
                win32args = (char *)command;  // quoted
        }
index aadb2ac..f221d7b 100644 (file)
@@ -43,17 +43,17 @@ static struct counters *counter_updates;
 
 // Returns a formatted version of a statistics value, or NULL if the statistics
 // line shouldn't be printed. Caller frees.
-typedef char *format_fn(uint64_t value);
+typedef char *(*format_fn)(uint64_t value);
 
-static format_fn format_size_times_1024;
-static format_fn format_timestamp;
+static char *format_size_times_1024(uint64_t size);
+static char *format_timestamp(uint64_t timestamp);
 
 // Statistics fields in display order.
 static struct {
        enum stats stat;
        const char *id; // for --print-stats
        const char *message; // for --show-stats
-       format_fn *format_fn; // NULL -> use plain integer format
+       format_fn format; // NULL -> use plain integer format
        unsigned flags;
 } stats_info[] = {
        {
@@ -553,8 +553,8 @@ stats_summary(void)
                }
 
                char *value;
-               if (stats_info[i].format_fn) {
-                       value = stats_info[i].format_fn(counters->data[stat]);
+               if (stats_info[i].format) {
+                       value = stats_info[i].format(counters->data[stat]);
                } else {
                        value = format("%8u", counters->data[stat]);
                }
index 0887428..1af3e03 100644 (file)
@@ -1 +1 @@
-extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7";
+extern const char CCACHE_VERSION[]; const char CCACHE_VERSION[] = "3.7.1";
index 3d2f2ad..a13f842 100644 (file)
@@ -109,6 +109,21 @@ SUITE_depend() {
     expect_stat 'files in cache' 3
 
     # -------------------------------------------------------------------------
+    TEST "No dependency file"
+
+    CCACHE_DEPEND=1 $CCACHE_COMPILE -MP -MMD -MF /dev/null -c test.c
+    expect_stat 'cache hit (direct)' 0
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 2 # .o + .manifest
+
+    CCACHE_DEPEND=1 $CCACHE_COMPILE -MP -MMD -MF /dev/null -c test.c
+    expect_stat 'cache hit (direct)' 1
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 2
+
+    # -------------------------------------------------------------------------
     TEST "No explicit dependency file"
 
     $REAL_COMPILER $DEPSFLAGS_REAL -c -o reference_test.o test.c
index 643471c..1373044 100644 (file)
@@ -439,6 +439,37 @@ EOF
     rm -f third_name.d
 
     # -------------------------------------------------------------------------
+    TEST "MF /dev/null"
+
+    $CCACHE_COMPILE -c -MD -MF /dev/null test.c
+    expect_stat 'cache hit (direct)' 0
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 2 # .o + .manifest
+
+    $CCACHE_COMPILE -c -MD -MF /dev/null test.c
+    expect_stat 'cache hit (direct)' 1
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+    expect_stat 'files in cache' 2
+
+    $CCACHE_COMPILE -c -MD -MF test.d test.c
+    expect_stat 'cache hit (direct)' 1
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 2
+    expect_stat 'files in cache' 5
+    expect_equal_files test.d expected.d
+
+    rm -f test.d
+
+    $CCACHE_COMPILE -c -MD -MF test.d test.c
+    expect_stat 'cache hit (direct)' 2
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 2
+    expect_stat 'files in cache' 5
+    expect_equal_files test.d expected.d
+
+    # -------------------------------------------------------------------------
     TEST "Missing .d file"
 
     $CCACHE_COMPILE -c -MD test.c
index 4eb9bf6..ad5b490 100644 (file)
@@ -139,4 +139,17 @@ SUITE_direct_gcc() {
     expect_stat 'cache miss' 1
     expect_equal_files different_name.d expected_sunpro_dependencies_target.d
     expect_equal_object_files reference_test.o test.o
+
+    # -------------------------------------------------------------------------
+    TEST "DEPENDENCIES_OUTPUT environment variable set to /dev/null"
+
+    DEPENDENCIES_OUTPUT="/dev/null" $CCACHE_COMPILE -c test.c
+    expect_stat 'cache hit (direct)' 0
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 1
+
+    DEPENDENCIES_OUTPUT="other.d" $CCACHE_COMPILE -c test.c
+    expect_stat 'cache hit (direct)' 0
+    expect_stat 'cache hit (preprocessed)' 0
+    expect_stat 'cache miss' 2
 }
index 3893f91..43170c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2010-2018 Joel Rosdahl
+// Copyright (C) 2010-2019 Joel Rosdahl
 //
 // This program is free software; you can redistribute it and/or modify it
 // under the terms of the GNU General Public License as published by the Free
@@ -294,7 +294,7 @@ cct_create_fresh_dir(const char *path)
 {
        cct_wipe(path);
        if (mkdir(path, 0777) != 0) {
-               fprintf(stderr, "mkdir: %s: %s", path, strerror(errno));;
+               fprintf(stderr, "mkdir: %s: %s", path, strerror(errno));
                abort();
        }
 }