Imported Upstream version 3.2.5 upstream/3.2.5
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:17:09 +0000 (16:17 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:17:09 +0000 (16:17 +0900)
31 files changed:
AUTHORS.html
AUTHORS.txt
INSTALL.html
LICENSE.html
LICENSE.txt
MANUAL.html
MANUAL.txt
Makefile.in
NEWS.html
NEWS.txt
README.html
ccache.1
ccache.c
ccache.h
cleanup.c
compopt.c
compopt.h
conf.c
config.h.in
configure
dev.mk.in
execute.c
exitfn.c
lockfile.c
m4/feature_macros.m4 [new file with mode: 0644]
m4/snprintf.m4 [new file with mode: 0644]
manifest.c
stats.c
test/test_conf.c
util.c
version.c

index 66fc0f6..8a2d4e6 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.2.4</span>\r
+<span id="revnumber">version 3.2.5</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>
@@ -864,6 +864,11 @@ Karl Chen &lt;<a href="mailto:quarl@cs.berkeley.edu">quarl@cs.berkeley.edu</a>&g
 </li>\r
 <li>\r
 <p>\r
+KonaBlend &lt;<a href="mailto:kona8lend@gmail.com">kona8lend@gmail.com</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Kovarththanan Rajaratnam &lt;<a href="mailto:kovarththanan.rajaratnam@gmail.com">kovarththanan.rajaratnam@gmail.com</a>&gt;\r
 </p>\r
 </li>\r
@@ -899,6 +904,11 @@ Martin Pool &lt;<a href="mailto:mbp@sourcefrog.net">mbp@sourcefrog.net</a>&gt;
 </li>\r
 <li>\r
 <p>\r
+Matthias Kretz &lt;<a href="mailto:kretz@kde.org">kretz@kde.org</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Michael Marineau &lt;<a href="mailto:michael.marineau@coreos.com">michael.marineau@coreos.com</a>&gt;\r
 </p>\r
 </li>\r
@@ -914,6 +924,21 @@ Mike Frysinger &lt;<a href="mailto:vapier@gentoo.org">vapier@gentoo.org</a>&gt;
 </li>\r
 <li>\r
 <p>\r
+Mikhail Kolomeytsev &lt;<a href="mailto:mkolom@yandex-team.ru">mkolom@yandex-team.ru</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Neil Mushell &lt;<a href="mailto:nmushell@bloomberg.net">nmushell@bloomberg.net</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Nick Schultz &lt;<a href="mailto:nick.schultz@intel.com">nick.schultz@intel.com</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Orgad Shaneh &lt;<a href="mailto:orgad.shaneh@audiocodes.com">orgad.shaneh@audiocodes.com</a>&gt;\r
 </p>\r
 </li>\r
@@ -995,9 +1020,9 @@ Yiding Jia &lt;<a href="mailto:yiding@fb.com">yiding@fb.com</a>&gt;
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2.4<br />\r
+Version 3.2.5<br />\r
 Last updated\r
- 2015-10-08 21:10:53 CEST\r
+ 2016-04-17 16:40:11 CEST\r
 </div>\r
 </div>\r
 </body>\r
index f837d52..2aedab2 100644 (file)
@@ -29,6 +29,7 @@ ccache is a collective work with contributions from many people, including:
 * Justin Lebar <justin.lebar@gmail.com>
 * Jørgen P. Tjernø <jorgen@valvesoftware.com>
 * Karl Chen <quarl@cs.berkeley.edu>
+* KonaBlend <kona8lend@gmail.com>
 * Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
 * Lalit Chhabra <lchhabra@linuxmail.org>
 * Lars Gustäbel <lars@gustaebel.de>
@@ -36,9 +37,13 @@ ccache is a collective work with contributions from many people, including:
 * Luboš Luňák <l.lunak@suse.cz>
 * Mark Starovoytov <starovoytov.mark@googlemail.com>
 * Martin Pool <mbp@sourcefrog.net>
+* Matthias Kretz <kretz@kde.org>
 * Michael Marineau <michael.marineau@coreos.com>
 * Michael Meeks <michael.meeks@suse.com>
 * Mike Frysinger <vapier@gentoo.org>
+* Mikhail Kolomeytsev <mkolom@yandex-team.ru>
+* Neil Mushell <nmushell@bloomberg.net>
+* Nick Schultz <nick.schultz@intel.com>
 * Orgad Shaneh <orgad.shaneh@audiocodes.com>
 * Owen Mann <owen@mann.org>
 * Patrick von Reth <vonreth@kde.org>
index 0455972..a8e690c 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache installation</h1>\r
-<span id="revnumber">version 3.2.3</span>\r
+<span id="revnumber">version 3.2.4+101_g4218b81</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>
@@ -848,9 +848,9 @@ above.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2.3<br />\r
+Version 3.2.4+101_g4218b81<br />\r
 Last updated\r
- 2015-06-28 18:38:00 CEST\r
+ 2016-02-06 17:21:49 CET\r
 </div>\r
 </div>\r
 </body>\r
index 440c67d..1ff2d6f 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.2.3</span>\r
+<span id="revnumber">version 3.2.5</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>
@@ -776,7 +776,7 @@ copyrights on their portions of the work.</p></div>
 <div class="listingblock">\r
 <div class="content">\r
 <pre><code>  Copyright (C) 2002-2007 Andrew Tridgell\r
-  Copyright (C) 2009-2015 Joel Rosdahl</code></pre>\r
+  Copyright (C) 2009-2016 Joel Rosdahl</code></pre>\r
 </div></div>\r
 </div>\r
 </div>\r
@@ -1205,9 +1205,9 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.2.3<br />\r
+Version 3.2.5<br />\r
 Last updated\r
- 2015-06-03 20:41:29 CEST\r
+ 2016-04-17 16:43:39 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 5d32ea2..abe3bd9 100644 (file)
@@ -38,7 +38,7 @@ The copyright for ccache as a whole is as follows:
 
 -------------------------------------------------------------------------------
   Copyright (C) 2002-2007 Andrew Tridgell
-  Copyright (C) 2009-2015 Joel Rosdahl
+  Copyright (C) 2009-2016 Joel Rosdahl
 -------------------------------------------------------------------------------
 
 
index 7012ff9..f393eff 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.2.3</span>\r
+<span id="revnumber">version 3.2.5</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>
@@ -1068,7 +1068,7 @@ example, <strong>CCACHE_COMPRESS</strong> can be set to force compression and
 <h3 id="_configuration_settings">Configuration settings</h3>\r
 <div class="paragraph"><p>Below is a list of available configuration settings. The corresponding\r
 environment variable name is indicated in parentheses after each configuration\r
-setting key. Boolean options are indicated with &#8220;[boolean]&#8221;</p></div>\r
+setting key.</p></div>\r
 <div class="dlist"><dl>\r
 <dt class="hdlist1">\r
 <strong>base_dir</strong> (<strong>CCACHE_BASEDIR</strong>)\r
@@ -1209,7 +1209,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </div></div>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>compression</strong> (<strong>CCACHE_COMPRESS</strong>) [boolean]\r
+<strong>compression</strong> (<strong>CCACHE_COMPRESS</strong> or <strong>CCACHE_NOCOMPRESS</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1243,7 +1243,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>direct_mode</strong> (<strong>CCACHE_DIRECT</strong>) [boolean]\r
+<strong>direct_mode</strong> (<strong>CCACHE_DIRECT</strong> or <strong>CCACHE_NODIRECT</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1252,7 +1252,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>disable</strong> (<strong>CCACHE_DISABLE</strong>) [boolean]\r
+<strong>disable</strong> (<strong>CCACHE_DISABLE</strong> or <strong>CCACHE_NODISABLE</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1271,7 +1271,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>hard_link</strong> (<strong>CCACHE_HARDLINK</strong>) [boolean]\r
+<strong>hard_link</strong> (<strong>CCACHE_HARDLINK</strong> or <strong>CCACHE_NOHARDLINK</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1286,7 +1286,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>hash_dir</strong> (<strong>CCACHE_HASHDIR</strong>) [boolean]\r
+<strong>hash_dir</strong> (<strong>CCACHE_HASHDIR</strong> or <strong>CCACHE_NOHASHDIR</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1351,7 +1351,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>read_only</strong> (<strong>CCACHE_READONLY</strong>) [boolean]\r
+<strong>read_only</strong> (<strong>CCACHE_READONLY</strong> or <strong>CCACHE_NOREADONLY</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1362,7 +1362,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>read_only_direct</strong> (<strong>CCACHE_READONLY_DIRECT</strong>) [boolean]\r
+<strong>read_only_direct</strong> (<strong>CCACHE_READONLY_DIRECT</strong> or <strong>CCACHE_NOREADONLY_DIRECT</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1372,7 +1372,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>recache</strong> (<strong>CCACHE_RECACHE</strong>) [boolean]\r
+<strong>recache</strong> (<strong>CCACHE_RECACHE</strong> or <strong>CCACHE_NORECACHE</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1381,7 +1381,7 @@ the <strong>prefix_command</strong> setting if possible. See
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>run_second_cpp</strong> (<strong>CCACHE_CPP2</strong>) [boolean]\r
+<strong>run_second_cpp</strong> (<strong>CCACHE_CPP2</strong> or <strong>CCACHE_NOCPP2</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1466,7 +1466,7 @@ the <strong>prefix_command</strong> setting if possible. See
 information.</p></div>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>stats</strong> (<strong>CCACHE_STATS</strong>) [boolean]\r
+<strong>stats</strong> (<strong>CCACHE_STATS</strong> or <strong>CCACHE_NOSTATS</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -1505,7 +1505,7 @@ information.</p></div>
 </p>\r
 </dd>\r
 <dt class="hdlist1">\r
-<strong>unify</strong> (<strong>CCACHE_UNIFY</strong>) [boolean]\r
+<strong>unify</strong> (<strong>CCACHE_UNIFY</strong> or <strong>CCACHE_NOUNIFY</strong>, see <a href="#_boolean_values">Boolean values</a> above)\r
 </dt>\r
 <dd>\r
 <p>\r
@@ -2036,38 +2036,36 @@ A modification time of one of the include files is too new (created the same
 <li>\r
 <p>\r
 The <strong>__TIME__</strong> preprocessor macro is (potentially) being used. ccache\r
-   turns off direct mode if &#8220;__TIME__&#8221; is present in the source code\r
-   outside comments and string literals. This is done as a safety measure since\r
-   the string indicates that a <strong>__TIME__</strong> macro <em>may</em> affect the output. (To\r
-   be sure, ccache would have to run the preprocessor, but the sole point of\r
-   the direct mode is to avoid that.) If you know that <strong>__TIME__</strong> isn&#8217;t used\r
-   in practise, or don&#8217;t care if ccache produces objects where <strong>__TIME__</strong> is\r
-   expanded to something in the past, you can set <strong>sloppiness</strong> to\r
-   <strong>time_macros</strong>.\r
+   turns off direct mode if &#8220;__TIME__&#8221; is present in the source code. This\r
+   is done as a safety measure since the string indicates that a <strong>__TIME__</strong>\r
+   macro <em>may</em> affect the output. (To be sure, ccache would have to run the\r
+   preprocessor, but the sole point of the direct mode is to avoid that.) If\r
+   you know that <strong>__TIME__</strong> isn&#8217;t used in practise, or don&#8217;t care if ccache\r
+   produces objects where <strong>__TIME__</strong> is expanded to something in the past,\r
+   you can set <strong>sloppiness</strong> to <strong>time_macros</strong>.\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
 The <strong>__DATE__</strong> preprocessor macro is (potentially) being used and the\r
    date has changed. This is similar to how <strong>__TIME__</strong> is handled. If\r
-   &#8220;__DATE__&#8221; is present in the source code outside comments and string\r
-   literals, ccache hashes the current date in order to be able to produce the\r
-   correct object file if the <strong>__DATE__</strong> macro affects the output. If you\r
-   know that <strong>__DATE__</strong> isn&#8217;t used in practise, or don&#8217;t care if ccache\r
-   produces objects where <strong>__DATE__</strong> is expanded to something in the past,\r
-   you can set <strong>sloppiness</strong> to <strong>time_macros</strong>.\r
+   &#8220;__DATE__&#8221; is present in the source code, ccache hashes the current\r
+   date in order to be able to produce the correct object file if the\r
+   <strong>__DATE__</strong> macro affects the output. If you know that <strong>__DATE__</strong> isn&#8217;t\r
+   used in practise, or don&#8217;t care if ccache produces objects where\r
+   <strong>__DATE__</strong> is expanded to something in the past, you can set <strong>sloppiness</strong>\r
+   to <strong>time_macros</strong>.\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
 The <strong>__FILE__</strong> preprocessor macro is (potentially) being used and the\r
-   file path has changed. If &#8220;__FILE__&#8221; is present in the source code\r
-   outside comments and string literals, ccache hashes the current input file\r
-   path in order to be able to produce the correct object file if the\r
-   <strong>__FILE__</strong> macro affects the output. If you know that <strong>__FILE__</strong> isn&#8217;t\r
-   used in practise, or don&#8217;t care if ccache produces objects where\r
-   <strong>__FILE__</strong> is expanded to the wrong path, you can set <strong>sloppiness</strong> to\r
-   <strong>file_macro</strong>.\r
+   file path has changed. If &#8220;__FILE__&#8221; is present in the source code,\r
+   ccache hashes the current input file path in order to be able to produce the\r
+   correct object file if the <strong>__FILE__</strong> macro affects the output. If you\r
+   know that <strong>__FILE__</strong> isn&#8217;t used in practise, or don&#8217;t care if ccache\r
+   produces objects where <strong>__FILE__</strong> is expanded to the wrong path, you can\r
+   set <strong>sloppiness</strong> to <strong>file_macro</strong>.\r
 </p>\r
 </li>\r
 </ul></div>\r
@@ -2169,9 +2167,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.2.3<br />\r
+Version 3.2.5<br />\r
 Last updated\r
- 2015-06-03 20:41:29 CEST\r
+ 2016-04-17 16:43:39 CEST\r
 </div>\r
 </div>\r
 </body>\r
index d0ee09b..9993019 100644 (file)
@@ -232,7 +232,7 @@ Configuration settings
 
 Below is a list of available configuration settings. The corresponding
 environment variable name is indicated in parentheses after each configuration
-setting key. Boolean options are indicated with ``[boolean]''
+setting key.
 
 *base_dir* (*CCACHE_BASEDIR*)::
 
@@ -314,7 +314,7 @@ WRAPPERS>>.
 --
 --
 
-*compression* (*CCACHE_COMPRESS*) [boolean]::
+*compression* (*CCACHE_COMPRESS* or *CCACHE_NOCOMPRESS*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will compress object files and other compiler output it
     puts in the cache. However, this setting has no effect on how files are
@@ -336,12 +336,12 @@ WRAPPERS>>.
     compiled, but that sometimes doesn't work. For example, when using the
     ``aCC'' compiler on HP-UX, set the cpp extension to *i*.
 
-*direct_mode* (*CCACHE_DIRECT*) [boolean]::
+*direct_mode* (*CCACHE_DIRECT* or *CCACHE_NODIRECT*, see <<_boolean_values,Boolean values>> above)::
 
     If true, the direct mode will be used. The default is true. See
     <<_the_direct_mode,THE DIRECT MODE>>.
 
-*disable* (*CCACHE_DISABLE*) [boolean]::
+*disable* (*CCACHE_DISABLE* or *CCACHE_NODISABLE*, see <<_boolean_values,Boolean values>> above)::
 
     When true, ccache will just call the real compiler, bypassing the cache
     completely. The default is false.
@@ -352,7 +352,7 @@ WRAPPERS>>.
     the hash sum that idetifies the build. The list separator is semicolon on
     Windows systems and colon on other systems.
 
-*hard_link* (*CCACHE_HARDLINK*) [boolean]::
+*hard_link* (*CCACHE_HARDLINK* or *CCACHE_NOHARDLINK*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will attempt to use hard links from the cache directory
     when creating the compiler output rather than using a file copy. Using hard
@@ -363,7 +363,7 @@ WRAPPERS>>.
     compressed cache files. This means that you should not enable compression
     if you want to use hard links. The default is false.
 
-*hash_dir* (*CCACHE_HASHDIR*) [boolean]::
+*hash_dir* (*CCACHE_HASHDIR* or *CCACHE_NOHASHDIR*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will include the current working directory in the hash that
     is used to distinguish two compilations. This prevents a problem with the
@@ -405,25 +405,25 @@ WRAPPERS>>.
     <<_using_ccache_with_other_compiler_wrappers,USING CCACHE WITH OTHER
     COMPILER WRAPPERS>>.
 
-*read_only* (*CCACHE_READONLY*) [boolean]::
+*read_only* (*CCACHE_READONLY* or *CCACHE_NOREADONLY*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will attempt to use existing cached object files, but it
     will not to try to add anything new to the cache. If you are using this
     because your ccache directory is read-only, then you need to set
     *temporary_dir* as otherwise ccache will fail to create temporary files.
 
-*read_only_direct* (*CCACHE_READONLY_DIRECT*) [boolean]::
+*read_only_direct* (*CCACHE_READONLY_DIRECT* or *CCACHE_NOREADONLY_DIRECT*, see <<_boolean_values,Boolean values>> above)::
 
     Just like *read_only* except that ccache will only try to retrieve results
     from the cache using the direct mode, not the preprocessor mode. See
     documentation for *read_only* regarding using a read-only ccache directory.
 
-*recache* (*CCACHE_RECACHE*) [boolean]::
+*recache* (*CCACHE_RECACHE* or *CCACHE_NORECACHE*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will not use any previously stored result. New results will
     still be cached, possibly overwriting any pre-existing results.
 
-*run_second_cpp* (*CCACHE_CPP2*) [boolean]::
+*run_second_cpp* (*CCACHE_CPP2* or *CCACHE_NOCPP2*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will not use the optimisation of avoiding the second call
     to the preprocessor by compiling the preprocessed output that was used for
@@ -463,7 +463,7 @@ WRAPPERS>>.
 See the discussion under <<_troubleshooting,TROUBLESHOOTING>> for more
 information.
 
-*stats* (*CCACHE_STATS*) [boolean]::
+*stats* (*CCACHE_STATS* or *CCACHE_NOSTATS*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will update the statistics counters on each compilation.
     The default is true.
@@ -484,7 +484,7 @@ NOTE: In previous versions of ccache, *CCACHE_TEMPDIR* had to be on the same
     with other users. Note that this also affects the file permissions set on
     the object files created from your compilations.
 
-*unify* (*CCACHE_UNIFY*) [boolean]::
+*unify* (*CCACHE_UNIFY* or *CCACHE_NOUNIFY*, see <<_boolean_values,Boolean values>> above)::
 
     If true, ccache will use a C/C++ unifier when hashing the preprocessor
     output if the *-g* option is not used. The unifier is slower than a normal
@@ -816,30 +816,28 @@ problems and what may be done to increase the hit rate:
    output, which contains data from the old header file; the wrong object file
    is stored in the cache.)
 ** The *\_\_TIME\__* preprocessor macro is (potentially) being used. ccache
-   turns off direct mode if ``\_\_TIME\__'' is present in the source code
-   outside comments and string literals. This is done as a safety measure since
-   the string indicates that a *\_\_TIME\__* macro _may_ affect the output. (To
-   be sure, ccache would have to run the preprocessor, but the sole point of
-   the direct mode is to avoid that.) If you know that *\_\_TIME\__* isn't used
-   in practise, or don't care if ccache produces objects where *\_\_TIME__* is
-   expanded to something in the past, you can set *sloppiness* to
-   *time_macros*.
+   turns off direct mode if ``\_\_TIME\__'' is present in the source code. This
+   is done as a safety measure since the string indicates that a *\_\_TIME\__*
+   macro _may_ affect the output. (To be sure, ccache would have to run the
+   preprocessor, but the sole point of the direct mode is to avoid that.) If
+   you know that *\_\_TIME\__* isn't used in practise, or don't care if ccache
+   produces objects where *\_\_TIME__* is expanded to something in the past,
+   you can set *sloppiness* to *time_macros*.
 ** The *\_\_DATE\__* preprocessor macro is (potentially) being used and the
    date has changed. This is similar to how *\_\_TIME\__* is handled. If
-   ``\_\_DATE\__'' is present in the source code outside comments and string
-   literals, ccache hashes the current date in order to be able to produce the
-   correct object file if the *\_\_DATE\__* macro affects the output. If you
-   know that *\_\_DATE\__* isn't used in practise, or don't care if ccache
-   produces objects where *\_\_DATE__* is expanded to something in the past,
-   you can set *sloppiness* to *time_macros*.
-** The *\_\_FILE\__* preprocessor macro is (potentially) being used and the
-   file path has changed. If ``\_\_FILE\__'' is present in the source code
-   outside comments and string literals, ccache hashes the current input file
-   path in order to be able to produce the correct object file if the
-   *\_\_FILE\__* macro affects the output. If you know that *\_\_FILE\__* isn't
+   ``\_\_DATE\__'' is present in the source code, ccache hashes the current
+   date in order to be able to produce the correct object file if the
+   *\_\_DATE\__* macro affects the output. If you know that *\_\_DATE\__* isn't
    used in practise, or don't care if ccache produces objects where
-   *\_\_FILE__* is expanded to the wrong path, you can set *sloppiness* to
-   *file_macro*.
+   *\_\_DATE__* is expanded to something in the past, you can set *sloppiness*
+   to *time_macros*.
+** The *\_\_FILE\__* preprocessor macro is (potentially) being used and the
+   file path has changed. If ``\_\_FILE\__'' is present in the source code,
+   ccache hashes the current input file path in order to be able to produce the
+   correct object file if the *\_\_FILE\__* macro affects the output. If you
+   know that *\_\_FILE\__* isn't used in practise, or don't care if ccache
+   produces objects where *\_\_FILE__* is expanded to the wrong path, you can
+   set *sloppiness* to *file_macro*.
 * If ``cache miss'' has been incremented even though the same code has been
   compiled and cached before, ccache has either detected that something has
   changed anyway or a cleanup has been performed (either explicitly or
index 30beb2b..d474f2a 100644 (file)
@@ -22,11 +22,32 @@ all_cflags = $(CFLAGS)
 all_cppflags = @DEFS@ -DSYSCONFDIR=$(sysconfdir) -I. -I$(srcdir) $(CPPFLAGS)
 extra_libs = @extra_libs@
 
-base_sources = \
-    ccache.c mdfour.c hash.c execute.c util.c args.c stats.c version.c \
-    cleanup.c snprintf.c unify.c manifest.c hashtable.c hashtable_itr.c \
-    murmurhashneutral2.c hashutil.c getopt_long.c exitfn.c lockfile.c \
-    counters.c language.c compopt.c conf.c
+non_3pp_sources = \
+    args.c \
+    ccache.c \
+    cleanup.c \
+    compopt.c \
+    conf.c \
+    counters.c \
+    execute.c \
+    exitfn.c \
+    hash.c \
+    hashutil.c \
+    language.c \
+    lockfile.c \
+    manifest.c \
+    mdfour.c \
+    stats.c \
+    unify.c \
+    util.c \
+    version.c
+3pp_sources = \
+    getopt_long.c \
+    hashtable.c \
+    hashtable_itr.c \
+    murmurhashneutral2.c \
+    snprintf.c
+base_sources = $(non_3pp_sources) $(3pp_sources)
 base_objs = $(base_sources:.c=.o)
 
 ccache_sources = main.c $(base_sources)
@@ -55,7 +76,7 @@ ccache$(EXEEXT): $(ccache_objs) $(extra_libs)
        $(CC) $(all_cflags) -o $@ $(ccache_objs) $(LDFLAGS) $(extra_libs) $(LIBS)
 
 .PHONY: install
-install: all
+install: all $(srcdir)/ccache.1
        $(installcmd) -d $(DESTDIR)$(bindir)
        $(installcmd) -m 755 ccache$(EXEEXT) $(DESTDIR)$(bindir)
        $(installcmd) -d $(DESTDIR)$(mandir)/man1
index 7bd6950..9f16a1c 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.2.4</span>\r
+<span id="revnumber">version 3.2.5</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>
@@ -742,11 +742,92 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_2_5">ccache 3.2.5</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2016-04-17</p></div>\r
+<div class="sect2">\r
+<h3 id="_new_features_and_improvements">New features and improvements</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Only pass clang-specific <code>-stdlib=</code> to the preprocessor.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Improved handling of stale NFS handles.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Made it harder to misinterpret documentation of boolean environment settings'\r
+  semantics.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Include m4 files used by configure.ac in the source dist archives.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Corrected "Performance" section in the manual regarding <code>__DATE_</code>, <code>__TIME__</code>\r
+  and <code>__FILE__</code> macros.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed build on Solaris 10+ and AIX 7.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed failure to create directories on QNX.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Don&#8217;t (try to) update manifest file in &#8220;read-only&#8221; and &#8220;read-only direct&#8221;\r
+  modes.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed a bug in caching of <code>stat</code> system calls in &#8220;file_stat_matches\r
+  sloppiness mode&#8221;.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed bug in hashing of clang plugins, leading to unnecessary cache misses.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed --print-config to show &#8220;pch_defines sloppiness&#8221;.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+The man page is now built when running &#8220;make install&#8221; from Git repository\r
+  sources.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_2_4">ccache 3.2.4</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-10-08</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -791,7 +872,7 @@ Fixed a bug where cache cleanup could be run too early for caches larger than
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-08-16</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_2">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -801,7 +882,7 @@ Added support for compiler option <code>-gsplit-dwarf</code>.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -838,7 +919,7 @@ Only log "Disabling direct mode" once when failing to read potential include
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-05-10</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_2">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_3">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -855,7 +936,7 @@ Add support for caching code coverage results (compiling for gcov).
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -926,7 +1007,7 @@ Fixed build error when compiling ccache with recent clang versions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2014-12-10</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -967,7 +1048,7 @@ Added missing documentation for <code>max_files</code> and <code>max_size</code>
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2014-11-17</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_3">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_4">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1158,7 +1239,7 @@ Various other improvements of the test suite.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1189,7 +1270,7 @@ Fixed test suite failures when <code>CC</code> is a ccache-wrapped compiler.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2015-03-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1220,7 +1301,7 @@ Don&#8217;t try to reset a non-existing stats file. This avoids &#8220;No such f
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2014-10-19</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_4">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_5">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1272,7 +1353,7 @@ Stale files in the internal temporary directory (<code>&lt;ccache_dir&gt;/tmp</c
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1312,7 +1393,7 @@ Fixed problem with logging of current working directory.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1362,7 +1443,7 @@ Fixed test suite to work on ecryptfs.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-08-11</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_5">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_6">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1383,7 +1464,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1431,7 +1512,7 @@ Fixed <code>static_assert</code> macro definition clash with GCC 4.7.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1504,7 +1585,7 @@ Improved documentation on how to fix bad object files in the cache.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-08-21</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_6">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_7">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1514,7 +1595,7 @@ Rewrite argument to <code>--sysroot</code> if <code>CCACHE_BASEDIR</code> is use
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1535,7 +1616,7 @@ Fixed alignment of &#8220;called for preprocessing&#8221; counter.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-05-29</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_7">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_8">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1567,7 +1648,7 @@ Improved order of statistics counters in <code>ccache -s</code> output.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_12">Bug fixes</h3>\r
+<h3 id="_bug_fixes_13">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1600,7 +1681,7 @@ Systems that lack (and don&#8217;t need to be linked with) libm are now supporte
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_13">Bug fixes</h3>\r
+<h3 id="_bug_fixes_14">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1633,7 +1714,7 @@ The file handle in now correctly closed on write error when trying to create
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_14">Bug fixes</h3>\r
+<h3 id="_bug_fixes_15">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1660,7 +1741,7 @@ Portability fixes for HP-UX 11.00 and other esoteric systems.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_15">Bug fixes</h3>\r
+<h3 id="_bug_fixes_16">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1708,7 +1789,7 @@ The test suite now also works on systems that lack a /dev/zero.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_16">Bug fixes</h3>\r
+<h3 id="_bug_fixes_17">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1762,7 +1843,7 @@ Minor debug log message improvements.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-09-16</p></div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_8">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_9">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1830,7 +1911,7 @@ Added <code>-install_name</code> as an option known to take an argument. (This i
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_17">Bug fixes</h3>\r
+<h3 id="_bug_fixes_18">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1916,7 +1997,7 @@ New <code>HACKING.txt</code> file with some notes about ccache code conventions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_18">Bug fixes</h3>\r
+<h3 id="_bug_fixes_19">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1962,7 +2043,7 @@ The way the hashes are calculated has changed, so you won&#8217;t get cache hits
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_new_features_and_improvements_9">New features and improvements</h3>\r
+<h3 id="_new_features_and_improvements_10">New features and improvements</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2105,7 +2186,7 @@ The following options are no longer hashed in the preprocessor mode:
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_19">Bug fixes</h3>\r
+<h3 id="_bug_fixes_20">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -2250,9 +2331,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.2.4<br />\r
+Version 3.2.5<br />\r
 Last updated\r
- 2015-10-08 21:12:12 CEST\r
+ 2016-04-17 16:43:59 CEST\r
 </div>\r
 </div>\r
 </body>\r
index 084879d..a0fee0e 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -2,6 +2,47 @@ ccache news
 ===========
 
 
+ccache 3.2.5
+------------
+Release date: 2016-04-17
+
+New features and improvements
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Only pass clang-specific `-stdlib=` to the preprocessor.
+
+- Improved handling of stale NFS handles.
+
+- Made it harder to misinterpret documentation of boolean environment settings'
+  semantics.
+
+
+Bug fixes
+~~~~~~~~~
+
+- Include m4 files used by configure.ac in the source dist archives.
+
+- Corrected "Performance" section in the manual regarding `__DATE_`, `__TIME__`
+  and `__FILE__` macros.
+
+- Fixed build on Solaris 10+ and AIX 7.
+
+- Fixed failure to create directories on QNX.
+
+- Don't (try to) update manifest file in ``read-only'' and ``read-only direct''
+  modes.
+
+- Fixed a bug in caching of `stat` system calls in ``file_stat_matches
+  sloppiness mode''.
+
+- Fixed bug in hashing of clang plugins, leading to unnecessary cache misses.
+
+- Fixed --print-config to show ``pch_defines sloppiness''.
+
+- The man page is now built when running ``make install'' from Git repository
+  sources.
+
+
 ccache 3.2.4
 ------------
 Release date: 2015-10-08
index 7c5d01f..6872e84 100644 (file)
@@ -734,7 +734,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache README</h1>\r
-<span id="revnumber">version 3.1.11</span>\r
+<span id="revnumber">version 3.2.5</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>
@@ -830,9 +830,9 @@ Thiele&#8217;s &#8220;compilercache&#8221; (see <a href="http://www.erikyyy.de/c
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.11<br />\r
+Version 3.2.5<br />\r
 Last updated\r
- 2012-11-07 19:42:42 CET\r
+ 2016-04-17 16:43:39 CEST\r
 </div>\r
 </div>\r
 </body>\r
index e6110fb..b42a95f 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 10/08/2015
+.\"      Date: 04/17/2016
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.2.4
+.\"    Source: ccache 3.2.5
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "10/08/2015" "ccache 3\&.2\&.4" "ccache Manual"
+.TH "CCACHE" "1" "04/17/2016" "ccache 3\&.2\&.5" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -351,7 +351,7 @@ max_size = 10G
 Some settings are boolean values (i\&.e\&. truth values)\&. In a configuration file, such values must be set to the string \fBtrue\fR or \fBfalse\fR\&. For the corresponding environment variables, the semantics are a bit different: a set environment variable means \(lqtrue\(rq regardless of the value (even if set to the empty string), and an unset environment variable means \(lqfalse\(rq\&. Each boolean environment variable also has a negated form starting with \fBCCACHE_NO\fR\&. For example, \fBCCACHE_COMPRESS\fR can be set to force compression and \fBCCACHE_NOCOMPRESS\fR can be set to force no compression\&.
 .SS "Configuration settings"
 .sp
-Below is a list of available configuration settings\&. The corresponding environment variable name is indicated in parentheses after each configuration setting key\&. Boolean options are indicated with \(lq[boolean]\(rq
+Below is a list of available configuration settings\&. The corresponding environment variable name is indicated in parentheses after each configuration setting key\&.
 .PP
 \fBbase_dir\fR (\fBCCACHE_BASEDIR\fR)
 .RS 4
@@ -448,7 +448,7 @@ USING CCACHE WITH OTHER COMPILER WRAPPERS\&.
 .RE
 .RE
 .PP
-\fBcompression\fR (\fBCCACHE_COMPRESS\fR) [boolean]
+\fBcompression\fR (\fBCCACHE_COMPRESS\fR or \fBCCACHE_NOCOMPRESS\fR, see Boolean values above)
 .RS 4
 If true, ccache will compress object files and other compiler output it puts in the cache\&. However, this setting has no effect on how files are retrieved from the cache; compressed and uncompressed results will still be usable regardless of this setting\&. The default is false\&.
 .RE
@@ -466,13 +466,13 @@ This setting can be used to force a certain extension for the intermediate prepr
 \fBi\fR\&.
 .RE
 .PP
-\fBdirect_mode\fR (\fBCCACHE_DIRECT\fR) [boolean]
+\fBdirect_mode\fR (\fBCCACHE_DIRECT\fR or \fBCCACHE_NODIRECT\fR, see Boolean values above)
 .RS 4
 If true, the direct mode will be used\&. The default is true\&. See
 THE DIRECT MODE\&.
 .RE
 .PP
-\fBdisable\fR (\fBCCACHE_DISABLE\fR) [boolean]
+\fBdisable\fR (\fBCCACHE_DISABLE\fR or \fBCCACHE_NODISABLE\fR, see Boolean values above)
 .RS 4
 When true, ccache will just call the real compiler, bypassing the cache completely\&. The default is false\&.
 .RE
@@ -482,12 +482,12 @@ When true, ccache will just call the real compiler, bypassing the cache complete
 This setting is a list of paths to files that ccache will include in the the hash sum that idetifies the build\&. The list separator is semicolon on Windows systems and colon on other systems\&.
 .RE
 .PP
-\fBhard_link\fR (\fBCCACHE_HARDLINK\fR) [boolean]
+\fBhard_link\fR (\fBCCACHE_HARDLINK\fR or \fBCCACHE_NOHARDLINK\fR, see Boolean values above)
 .RS 4
 If true, ccache will attempt to use hard links from the cache directory when creating the compiler output rather than using a file copy\&. Using hard links may be slightly faster in some situations, but can confuse programs like \(lqmake\(rq that rely on modification times\&. Another thing to keep in mind is that if the resulting object file is modified in any way, this corrupts the cached object file as well\&. Hard links are never made for compressed cache files\&. This means that you should not enable compression if you want to use hard links\&. The default is false\&.
 .RE
 .PP
-\fBhash_dir\fR (\fBCCACHE_HASHDIR\fR) [boolean]
+\fBhash_dir\fR (\fBCCACHE_HASHDIR\fR or \fBCCACHE_NOHASHDIR\fR, see Boolean values above)
 .RS 4
 If true, ccache will include the current working directory in the hash that is used to distinguish two compilations\&. This prevents a problem with the storage of the current working directory in the debug info of a object file, which can lead ccache to give a cached object file that has the working directory in the debug info set incorrectly\&. This option is off by default as the incorrect setting of this debug info rarely causes problems\&. If you strike problems with GDB not using the correct directory then enable this option\&.
 .RE
@@ -520,14 +520,14 @@ This option adds a list of prefixes (separated by space) to the command line tha
 USING CCACHE WITH OTHER COMPILER WRAPPERS\&.
 .RE
 .PP
-\fBread_only\fR (\fBCCACHE_READONLY\fR) [boolean]
+\fBread_only\fR (\fBCCACHE_READONLY\fR or \fBCCACHE_NOREADONLY\fR, see Boolean values above)
 .RS 4
 If true, ccache will attempt to use existing cached object files, but it will not to try to add anything new to the cache\&. If you are using this because your ccache directory is read\-only, then you need to set
 \fBtemporary_dir\fR
 as otherwise ccache will fail to create temporary files\&.
 .RE
 .PP
-\fBread_only_direct\fR (\fBCCACHE_READONLY_DIRECT\fR) [boolean]
+\fBread_only_direct\fR (\fBCCACHE_READONLY_DIRECT\fR or \fBCCACHE_NOREADONLY_DIRECT\fR, see Boolean values above)
 .RS 4
 Just like
 \fBread_only\fR
@@ -536,12 +536,12 @@ except that ccache will only try to retrieve results from the cache using the di
 regarding using a read\-only ccache directory\&.
 .RE
 .PP
-\fBrecache\fR (\fBCCACHE_RECACHE\fR) [boolean]
+\fBrecache\fR (\fBCCACHE_RECACHE\fR or \fBCCACHE_NORECACHE\fR, see Boolean values above)
 .RS 4
 If true, ccache will not use any previously stored result\&. New results will still be cached, possibly overwriting any pre\-existing results\&.
 .RE
 .PP
-\fBrun_second_cpp\fR (\fBCCACHE_CPP2\fR) [boolean]
+\fBrun_second_cpp\fR (\fBCCACHE_CPP2\fR or \fBCCACHE_NOCPP2\fR, see Boolean values above)
 .RS 4
 If true, ccache will not use the optimisation of avoiding the second call to the preprocessor by compiling the preprocessed output that was used for finding the hash in the case of a cache miss\&. This is primarily a debugging option, although it is possible that some unusual compilers will have problems with compiling the preprocessed output, in which case this option could allow ccache to be used anyway\&.
 .RE
@@ -593,7 +593,7 @@ TROUBLESHOOTING
 for more information\&.
 .RE
 .PP
-\fBstats\fR (\fBCCACHE_STATS\fR) [boolean]
+\fBstats\fR (\fBCCACHE_STATS\fR or \fBCCACHE_NOSTATS\fR, see Boolean values above)
 .RS 4
 If true, ccache will update the statistics counters on each compilation\&. The default is true\&.
 .RE
@@ -628,7 +628,7 @@ path, but this requirement has been relaxed\&.)
 This setting specifies the umask for ccache and all child processes (such as the compiler)\&. This is mostly useful when you wish to share your cache with other users\&. Note that this also affects the file permissions set on the object files created from your compilations\&.
 .RE
 .PP
-\fBunify\fR (\fBCCACHE_UNIFY\fR) [boolean]
+\fBunify\fR (\fBCCACHE_UNIFY\fR or \fBCCACHE_NOUNIFY\fR, see Boolean values above)
 .RS 4
 If true, ccache will use a C/C++ unifier when hashing the preprocessor output if the
 \fB\-g\fR
@@ -1346,7 +1346,7 @@ if you are willing to take the risk\&. (The race condition consists of these eve
 .\}
 The
 \fB__TIME__\fR
-preprocessor macro is (potentially) being used\&. ccache turns off direct mode if \(lq__TIME__\(rq is present in the source code outside comments and string literals\&. This is done as a safety measure since the string indicates that a
+preprocessor macro is (potentially) being used\&. ccache turns off direct mode if \(lq__TIME__\(rq is present in the source code\&. This is done as a safety measure since the string indicates that a
 \fB__TIME__\fR
 macro
 \fImay\fR
@@ -1372,7 +1372,7 @@ The
 \fB__DATE__\fR
 preprocessor macro is (potentially) being used and the date has changed\&. This is similar to how
 \fB__TIME__\fR
-is handled\&. If \(lq__DATE__\(rq is present in the source code outside comments and string literals, ccache hashes the current date in order to be able to produce the correct object file if the
+is handled\&. If \(lq__DATE__\(rq is present in the source code, ccache hashes the current date in order to be able to produce the correct object file if the
 \fB__DATE__\fR
 macro affects the output\&. If you know that
 \fB__DATE__\fR
@@ -1394,7 +1394,7 @@ to
 .\}
 The
 \fB__FILE__\fR
-preprocessor macro is (potentially) being used and the file path has changed\&. If \(lq__FILE__\(rq is present in the source code outside comments and string literals, ccache hashes the current input file path in order to be able to produce the correct object file if the
+preprocessor macro is (potentially) being used and the file path has changed\&. If \(lq__FILE__\(rq is present in the source code, ccache hashes the current input file path in order to be able to produce the correct object file if the
 \fB__FILE__\fR
 macro affects the output\&. If you know that
 \fB__FILE__\fR
index 621f678..544c397 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2,7 +2,7 @@
  * ccache -- a fast C/C++ compiler cache
  *
  * Copyright (C) 2002-2007 Andrew Tridgell
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 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
@@ -39,7 +39,7 @@ static const char VERSION_TEXT[] =
   MYNAME " version %s\n"
   "\n"
   "Copyright (C) 2002-2007 Andrew Tridgell\n"
-  "Copyright (C) 2009-2015 Joel Rosdahl\n"
+  "Copyright (C) 2009-2016 Joel Rosdahl\n"
   "\n"
   "This program is free software; you can redistribute it and/or modify it under\n"
   "the terms of the GNU General Public License as published by the Free Software\n"
@@ -638,7 +638,7 @@ ignore:
 static char *
 make_relative_path(char *path)
 {
-       char *relpath, *canon_path, *path_suffix = NULL;
+       char *canon_path, *path_suffix = NULL;
        struct stat st;
 
        if (str_eq(conf->base_dir, "") || !str_startswith(path, conf->base_dir)) {
@@ -666,6 +666,7 @@ make_relative_path(char *path)
 
        canon_path = x_realpath(path);
        if (canon_path) {
+               char *relpath;
                free(path);
                relpath = get_relative_path(get_current_working_dir(), canon_path);
                free(canon_path);
@@ -800,6 +801,9 @@ put_file_in_cache(const char *source, const char *dest)
        struct stat st;
        bool do_link = conf->hard_link && !conf->compression;
 
+       assert(!conf->read_only);
+       assert(!conf->read_only_direct);
+
        if (do_link) {
                x_unlink(dest);
                ret = link(source, dest);
@@ -839,7 +843,7 @@ get_file_from_cache(const char *source, const char *dest)
        }
 
        if (ret == -1) {
-               if (errno == ENOENT) {
+               if (errno == ENOENT || errno == ESTALE) {
                        /* Someone removed the file just before we began copying? */
                        cc_log("Cache file %s just disappeared from cache", source);
                        stats_update(STATS_MISSING);
@@ -907,11 +911,10 @@ void update_manifest_file(void)
 static void
 to_cache(struct args *args)
 {
-       char *tmp_stdout, *tmp_stderr, *tmp_aux, *tmp_cov;
+       char *tmp_stdout, *tmp_stderr, *tmp_cov;
        char *tmp_dwo = NULL;
        struct stat st;
        int status, tmp_stdout_fd, tmp_stderr_fd;
-       FILE *f;
 
        tmp_stdout = format("%s.tmp.stdout", cached_obj);
        tmp_stdout_fd = create_tmp_fd(&tmp_stdout);
@@ -919,6 +922,7 @@ to_cache(struct args *args)
        tmp_stderr_fd = create_tmp_fd(&tmp_stderr);
 
        if (generating_coverage) {
+               char *tmp_aux;
                /* gcc has some funny rule about max extension length */
                if (strlen(get_extension(output_obj)) < 6) {
                        tmp_aux = remove_extension(output_obj);
@@ -1108,9 +1112,8 @@ to_cache(struct args *args)
        if (generating_coverage) {
                /* gcc won't generate notes if there is no code */
                if (stat(tmp_cov, &st) != 0 && errno == ENOENT) {
+                       FILE *f = fopen(cached_cov, "wb");
                        cc_log("Creating placeholder: %s", cached_cov);
-
-                       f = fopen(cached_cov, "wb");
                        if (!f) {
                                cc_log("Failed to create %s: %s", cached_cov, strerror(errno));
                                stats_update(STATS_ERROR);
@@ -1372,7 +1375,7 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
 {
        struct stat st;
        char *p;
-       const char *full_path = args->argv[0];
+       const char *full_path;
 #ifdef _WIN32
        const char *ext;
        char full_path_win_ext[MAX_PATH + 1] = {0};
@@ -1392,6 +1395,8 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
        add_exe_ext_if_no_to_fullpath(full_path_win_ext, MAX_PATH, ext,
                                      args->argv[0]);
        full_path = full_path_win_ext;
+#else
+       full_path = args->argv[0];
 #endif
 
        if (x_stat(full_path, &st) != 0) {
@@ -1425,7 +1430,6 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
 
        /* Possibly hash the coverage data file path. */
        if (generating_coverage && profile_arcs) {
-               char *gcda_path;
                char *dir = dirname(output_obj);
                if (profile_dir) {
                        dir = x_strdup(profile_dir);
@@ -1435,6 +1439,7 @@ calculate_common_hash(struct args *args, struct mdfour *hash)
                        dir = real_dir;
                }
                if (dir) {
+                       char *gcda_path;
                        char *base_name = basename(output_obj);
                        p = remove_extension(base_name);
                        free(base_name);
@@ -1482,9 +1487,7 @@ static struct file_hash *
 calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
 {
        int i;
-       char *manifest_name;
        struct stat st;
-       int result;
        struct file_hash *object_hash = NULL;
        char *p;
 
@@ -1589,6 +1592,7 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
                    && x_stat(args->argv[i+3], &st) == 0) {
                        hash_delimiter(hash, "plugin");
                        hash_compiler(hash, &st, args->argv[i+3], false);
+                       i += 3;
                        continue;
                }
 
@@ -1643,6 +1647,9 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode)
        }
 
        if (direct_mode) {
+               char *manifest_name;
+               int result;
+
                /* Hash environment variables that affect the preprocessor output. */
                const char **p;
                const char *envvars[] = {
@@ -1806,7 +1813,8 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest)
                update_mtime(cached_dwo);
        }
 
-       if (generating_dependencies && mode == FROMCACHE_CPP_MODE) {
+       if (generating_dependencies && mode == FROMCACHE_CPP_MODE
+           && !conf->read_only && !conf->read_only_direct) {
                put_file_in_cache(output_dep, cached_dep);
        }
 
index 0015c50..ca96d3b 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -155,7 +155,6 @@ char *strtok_r(char *str, const char *delim, char **saveptr);
 #endif
 int create_tmp_fd(char **fname);
 FILE *create_tmp_file(char **fname, const char *mode);
-void create_empty_tmp_file(char **fname);
 const char *get_home_directory(void);
 char *get_cwd(void);
 bool same_executable_name(const char *s1, const char *s2);
@@ -276,6 +275,8 @@ void add_exe_ext_if_no_to_fullpath(char *full_path_win_ext, size_t max_size,
 #    define PATH_DELIM ":"
 #endif
 
+#ifndef MAX
 #define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#endif
 
 #endif /* ifndef CCACHE_H */
index df945e7..dcb1a15 100644 (file)
--- a/cleanup.c
+++ b/cleanup.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2006 Andrew Tridgell
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 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
@@ -108,7 +108,7 @@ delete_file(const char *path, size_t size)
        if (x_unlink(path) == 0) {
                cache_size -= size;
                files_in_cache--;
-       } else if (errno != ENOENT) {
+       } else if (errno != ENOENT && errno != ESTALE) {
                cc_log("Failed to unlink %s (%s)", path, strerror(errno));
        }
 }
@@ -122,7 +122,7 @@ delete_sibling_file(const char *base, const char *extension)
        path = format("%s%s", base, extension);
        if (lstat(path, &st) == 0) {
                delete_file(path, file_size(&st));
-       } else if (errno != ENOENT) {
+       } else if (errno != ENOENT && errno != ESTALE) {
                cc_log("Failed to stat %s: %s", path, strerror(errno));
        }
        free(path);
@@ -134,7 +134,6 @@ static void
 sort_and_clean(void)
 {
        unsigned i;
-       const char *ext;
        char *last_base = x_strdup("");
 
        if (num_files > 1) {
@@ -144,6 +143,8 @@ sort_and_clean(void)
 
        /* delete enough files to bring us below the threshold */
        for (i = 0; i < num_files; i++) {
+               const char *ext;
+
                if ((cache_size_threshold == 0
                     || cache_size <= cache_size_threshold)
                    && (files_in_cache_threshold == 0
@@ -227,11 +228,10 @@ cleanup_dir(struct conf *conf, const char *dir)
 /* cleanup in all cache subdirs */
 void cleanup_all(struct conf *conf)
 {
-       char *dname;
        int i;
 
        for (i = 0; i <= 0xF; i++) {
-               dname = format("%s/%1x", conf->cache_dir, i);
+               char *dname = format("%s/%1x", conf->cache_dir, i);
                cleanup_dir(conf, dname);
                free(dname);
        }
@@ -259,11 +259,10 @@ static void wipe_fn(const char *fname, struct stat *st)
 /* wipe all cached files in all subdirs */
 void wipe_all(struct conf *conf)
 {
-       char *dname;
        int i;
 
        for (i = 0; i <= 0xF; i++) {
-               dname = format("%s/%1x", conf->cache_dir, i);
+               char *dname = format("%s/%1x", conf->cache_dir, i);
                traverse(dname, wipe_fn);
                free(dname);
        }
index e5b3e0a..87166df 100644 (file)
--- a/compopt.c
+++ b/compopt.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2015 Joel Rosdahl
+ * Copyright (C) 2010-2016 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
@@ -78,6 +78,7 @@ static const struct compopt compopts[] = {
        {"-nostdinc++",     AFFECTS_CPP},
        {"-remap",          AFFECTS_CPP},
        {"-save-temps",     TOO_HARD},
+       {"-stdlib=",        AFFECTS_CPP | TAKES_CONCAT_ARG},
        {"-trigraphs",      AFFECTS_CPP},
        {"-u",              TAKES_ARG},
 };
@@ -181,15 +182,6 @@ compopt_takes_arg(const char *option)
        return co && (co->type & TAKES_ARG);
 }
 
-/* Determines if argument takes a concatentated argument by comparing prefixes.
- */
-bool
-compopt_takes_concat_arg(const char *option)
-{
-       const struct compopt *co = find_prefix(option);
-       return co && (co->type & TAKES_CONCAT_ARG);
-}
-
 /* Determines if the prefix of the option matches any option and affects the
  * preprocessor.
  */
index 109094b..882187d 100644 (file)
--- a/compopt.h
+++ b/compopt.h
@@ -9,7 +9,6 @@ bool compopt_too_hard(const char *option);
 bool compopt_too_hard_for_direct_mode(const char *option);
 bool compopt_takes_path(const char *option);
 bool compopt_takes_arg(const char *option);
-bool compopt_takes_concat_arg(const char *option);
 bool compopt_prefix_affects_cpp(const char *option);
 
 #endif /* CCACHE_COMPOPT_H */
diff --git a/conf.c b/conf.c
index e8bd523..0179e2d 100644 (file)
--- a/conf.c
+++ b/conf.c
@@ -607,6 +607,9 @@ conf_print_items(struct conf *conf,
        if (conf->sloppiness & SLOPPY_TIME_MACROS) {
                reformat(&s, "%stime_macros, ", s);
        }
+       if (conf->sloppiness & SLOPPY_PCH_DEFINES) {
+               reformat(&s, "%spch_defines, ", s);
+       }
        if (conf->sloppiness & SLOPPY_FILE_STAT_MATCHES) {
                reformat(&s, "%sfile_stat_matches, ", s);
        }
index ae09008..cc67c93 100644 (file)
 /* Define on FreeBSD to activate all library features */
 #undef __BSD_VISIBLE
 
+/* Define to activate Unix95-and-earlier features */
+#undef __EXTENSIONS__
+
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const
 
index cd71d5f..ba2e7f3 100755 (executable)
--- a/configure
+++ b/configure
@@ -3645,7 +3645,7 @@ $as_echo "#define _BSD_SOURCE 1" >>confdefs.h
   # or has another value. By not (re)defining it, the defaults come in place.
   AIX/4)
     define_xopen_source=no;;
-  AIX/5)
+  AIX/5|AIX/7)
     if test `uname -r` -eq 1; then
       define_xopen_source=no
     fi
@@ -3684,7 +3684,10 @@ $as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h
   # except for Solaris 10, where it must not be defined,
   # as it implies XPG4.2
   case $ac_sys_system/$ac_sys_release in
-    SunOS/5.10)
+    SunOS/5.10|SunOS/5.11)
+
+$as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
       ;;
     *)
 
index 1261ad3..a6176f1 100644 (file)
--- a/dev.mk.in
+++ b/dev.mk.in
@@ -4,6 +4,8 @@ all_cflags += -Werror
 all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
 
 ASCIIDOC = asciidoc
+CPPCHECK = cppcheck
+CPPCHECK_SUPPRESSIONS = cppcheck-suppressions.txt
 GPERF = gperf
 XSLTPROC = xsltproc
 MANPAGE_XSL = $(shell if [ -e /usr/local/etc/asciidoc/docbook-xsl/manpage.xsl ]; \
@@ -77,6 +79,7 @@ source_dist_files = \
     envtoconfitems.gperf \
     envtoconfitems_lookup.c \
     install-sh \
+    m4 \
     main.c \
     test.sh \
     zlib/*.c \
@@ -150,6 +153,12 @@ ccache.1: MANUAL.xml
 check-syntax:
        $(CC) $(all_cppflags) -I. $(all_cflags) -S -o /dev/null $(CHK_SOURCES)
 
+.PHONY: cppcheck
+cppcheck:
+       $(CPPCHECK) --suppressions-list=$(CPPCHECK_SUPPRESSIONS) \
+         --inline-suppr -q --enable=all \
+         $(non_3pp_sources) main.c $(test_sources)
+
 .PHONY: uncrustify
 uncrustify:
        uncrustify -c uncrustify.cfg --no-backup --replace $(filter-out $(uncrustify_exclude_files), $(base_sources)) $(test_sources)
index 608a8f4..8681d5f 100644 (file)
--- a/execute.c
+++ b/execute.c
@@ -84,6 +84,7 @@ win32argvtos(char *prefix, char **argv)
                        *ptr++ = '\\';
                *ptr++ = '"';
                *ptr++ = ' ';
+               /* cppcheck-suppress unreadVariable */
        } while ((arg = argv[i++]));
        ptr[-1] = '\0';
 
index 29b7b9f..f59617a 100644 (file)
--- a/exitfn.c
+++ b/exitfn.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2015 Joel Rosdahl
+ * Copyright (C) 2010-2016 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
@@ -83,9 +83,10 @@ exitfn_add(void (*function)(void *), void *context)
 void
 exitfn_call(void)
 {
-       struct exit_function *p = exit_functions, *q;
+       struct exit_function *p = exit_functions;
        exit_functions = NULL;
        while (p) {
+               struct exit_function *q;
                p->function(p->context);
                q = p;
                p = p->next;
index f4f2028..b565e61 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2015 Joel Rosdahl
+ * Copyright (C) 2010-2016 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
@@ -130,6 +130,7 @@ lockfile_acquire(const char *path, unsigned staleness_limit)
                }
                free(content);
                content = x_readlink(lockfile);
+               /* cppcheck-suppress nullPointer - false positive */
                if (!content) {
                        if (errno == ENOENT) {
                                /*
diff --git a/m4/feature_macros.m4 b/m4/feature_macros.m4
new file mode 100644 (file)
index 0000000..0243e9f
--- /dev/null
@@ -0,0 +1,147 @@
+dnl ===========================================================================
+dnl Feature macro stuff borrowed from Python's configure.in
+dnl
+dnl For license information, see
+dnl <http://www.python.org/download/releases/2.6.2/license/>.
+dnl ===========================================================================
+
+# The later defininition of _XOPEN_SOURCE disables certain features
+# on Linux, so we need _GNU_SOURCE to re-enable them (makedev, tm_zone).
+AC_DEFINE(_GNU_SOURCE, 1, [Define on Linux to activate all library features])
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on NetBSD, so we need _NETBSD_SOURCE to re-enable
+# them.
+AC_DEFINE(_NETBSD_SOURCE, 1, [Define on NetBSD to activate all library features])
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on FreeBSD, so we need __BSD_VISIBLE to re-enable
+# them.
+AC_DEFINE(__BSD_VISIBLE, 1, [Define on FreeBSD to activate all library features])
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# u_int on Irix 5.3. Defining _BSD_TYPES brings it back.
+AC_DEFINE(_BSD_TYPES, 1, [Define on Irix to enable u_int])
+
+# The later defininition of _XOPEN_SOURCE and _POSIX_C_SOURCE disables
+# certain features on Mac OS X, so we need _DARWIN_C_SOURCE to re-enable
+# them.
+AC_DEFINE(_DARWIN_C_SOURCE, 1, [Define on Darwin to activate all library features])
+
+define_xopen_source=yes
+
+ac_sys_system=`uname -s`
+if test "$ac_sys_system" = "AIX" -o "$ac_sys_system" = "Monterey64" \
+   -o "$ac_sys_system" = "UnixWare" -o "$ac_sys_system" = "OpenUNIX"; then
+        ac_sys_release=`uname -v`
+else
+        ac_sys_release=`uname -r`
+fi
+
+# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
+# disable features if it is defined, without any means to access these
+# features as extensions. For these systems, we skip the definition of
+# _XOPEN_SOURCE. Before adding a system to the list to gain access to
+# some feature, make sure there is no alternative way to access this
+# feature. Also, when using wildcards, make sure you have verified the
+# need for not defining _XOPEN_SOURCE on all systems matching the
+# wildcard, and that the wildcard does not include future systems
+# (which may remove their limitations).
+dnl quadrigraphs "@<:@" and "@:>@" produce "[" and "]" in the output
+case $ac_sys_system/$ac_sys_release in
+  # On OpenBSD, select(2) is not available if _XOPEN_SOURCE is defined,
+  # even though select is a POSIX function. Reported by J. Ribbens.
+  # Reconfirmed for OpenBSD 3.3 by Zachary Hamm, for 3.4 by Jason Ish.
+  OpenBSD/2.* | OpenBSD/3.@<:@0123456789@:>@ | OpenBSD/4.@<:@0123@:>@)
+    define_xopen_source=no
+    # OpenBSD undoes our definition of __BSD_VISIBLE if _XOPEN_SOURCE is
+    # also defined. This can be overridden by defining _BSD_SOURCE
+    # As this has a different meaning on Linux, only define it on OpenBSD
+    AC_DEFINE(_BSD_SOURCE, 1, [Define on OpenBSD to activate all library features])
+    ;;
+  # Defining _XOPEN_SOURCE on NetBSD version prior to the introduction of
+  # _NETBSD_SOURCE disables certain features (eg. setgroups). Reported by
+  # Marc Recht
+  NetBSD/1.5 | NetBSD/1.5.* | NetBSD/1.6 | NetBSD/1.6.* | NetBSD/1.6@<:@A-S@:>@)
+    define_xopen_source=no;;
+  # On Solaris 2.6, sys/wait.h is inconsistent in the usage
+  # of union __?sigval. Reported by Stuart Bishop.
+  SunOS/5.6)
+    define_xopen_source=no;;
+  # On UnixWare 7, u_long is never defined with _XOPEN_SOURCE,
+  # but used in /usr/include/netinet/tcp.h. Reported by Tim Rice.
+  # Reconfirmed for 7.1.4 by Martin v. Loewis.
+  OpenUNIX/8.0.0| UnixWare/7.1.@<:@0-4@:>@)
+    define_xopen_source=no;;
+  # On OpenServer 5, u_short is never defined with _XOPEN_SOURCE,
+  # but used in struct sockaddr.sa_family. Reported by Tim Rice.
+  SCO_SV/3.2)
+    define_xopen_source=no;;
+  # On FreeBSD 4, the math functions C89 does not cover are never defined
+  # with _XOPEN_SOURCE and __BSD_VISIBLE does not re-enable them.
+  FreeBSD/4.*)
+    define_xopen_source=no;;
+  # On MacOS X 10.2, a bug in ncurses.h means that it craps out if
+  # _XOPEN_EXTENDED_SOURCE is defined. Apparently, this is fixed in 10.3, which
+  # identifies itself as Darwin/7.*
+  # On Mac OS X 10.4, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+  # disables platform specific features beyond repair.
+  # On Mac OS X 10.3, defining _POSIX_C_SOURCE or _XOPEN_SOURCE
+  # has no effect, don't bother defining them
+  Darwin/@<:@6789@:>@.*)
+    define_xopen_source=no;;
+  # On AIX 4 and 5.1, mbstate_t is defined only when _XOPEN_SOURCE == 500 but
+  # used in wcsnrtombs() and mbsnrtowcs() even if _XOPEN_SOURCE is not defined
+  # or has another value. By not (re)defining it, the defaults come in place.
+  AIX/4)
+    define_xopen_source=no;;
+  AIX/5|AIX/7)
+    if test `uname -r` -eq 1; then
+      define_xopen_source=no
+    fi
+    ;;
+  # On QNX 6.3.2, defining _XOPEN_SOURCE prevents netdb.h from
+  # defining NI_NUMERICHOST.
+  QNX/6.3.2)
+    define_xopen_source=no
+    ;;
+
+esac
+
+if test $define_xopen_source = yes
+then
+  # On Solaris w/ g++ it appears that _XOPEN_SOURCE has to be
+  # defined precisely as g++ defines it
+  # Furthermore, on Solaris 10, XPG6 requires the use of a C99
+  # compiler
+  case $ac_sys_system/$ac_sys_release in
+    SunOS/5.8|SunOS/5.9|SunOS/5.10)
+      AC_DEFINE(_XOPEN_SOURCE, 500,
+                Define to the level of X/Open that your system supports)
+      ;;
+    *)
+      AC_DEFINE(_XOPEN_SOURCE, 600,
+                Define to the level of X/Open that your system supports)
+      ;;
+  esac
+
+  # On Tru64 Unix 4.0F, defining _XOPEN_SOURCE also requires
+  # definition of _XOPEN_SOURCE_EXTENDED and _POSIX_C_SOURCE, or else
+  # several APIs are not declared. Since this is also needed in some
+  # cases for HP-UX, we define it globally.
+  # except for Solaris 10, where it must not be defined,
+  # as it implies XPG4.2
+  case $ac_sys_system/$ac_sys_release in
+    SunOS/5.10|SunOS/5.11)
+      AC_DEFINE(__EXTENSIONS__, 1,
+                Define to activate Unix95-and-earlier features)
+      ;;
+    *)
+      AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1,
+                Define to activate Unix95-and-earlier features)
+      ;;
+  esac
+
+  AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001)
+
+fi
diff --git a/m4/snprintf.m4 b/m4/snprintf.m4
new file mode 100644 (file)
index 0000000..7d3aa06
--- /dev/null
@@ -0,0 +1,224 @@
+# $Id: snprintf.m4,v 1.1.1.1 2008/01/06 03:24:00 holger Exp $
+
+# Copyright (c) 2008 Holger Weiss <holger@jhweiss.de>.
+#
+# This 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.
+
+# HW_HEADER_STDARG_H
+# ------------------
+# Define HAVE_STDARG_H to 1 if <stdarg.h> is available.
+AC_DEFUN([HW_HEADER_STDARG_H],
+[
+  AC_PREREQ([2.60])dnl Older releases should work if AC_CHECK_HEADERS is used.
+  AC_CHECK_HEADERS_ONCE([stdarg.h])
+])# HW_HEADER_STDARG_H
+
+# HW_HEADER_VARARGS_H
+# -------------------
+# Define HAVE_VARARGS_H to 1 if <varargs.h> is available.
+AC_DEFUN([HW_HEADER_VARARGS_H],
+[
+  AC_PREREQ([2.60])dnl Older releases should work if AC_CHECK_HEADERS is used.
+  AC_CHECK_HEADERS_ONCE([varargs.h])
+])# HW_HEADER_VARARGS_H
+
+# HW_FUNC_VA_COPY
+# ---------------
+# Set $hw_cv_func_va_copy to "yes" or "no".  Define HAVE_VA_COPY to 1 if
+# $hw_cv_func_va_copy is set to "yes".  Note that it's "unspecified whether
+# va_copy and va_end are macros or identifiers declared with external linkage."
+# (C99: 7.15.1, 1)  Therefore, the presence of va_copy(3) cannot simply "be
+# tested with #ifdef", as suggested by the Autoconf manual (5.5.1).
+AC_DEFUN([HW_FUNC_VA_COPY],
+[
+  AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+  AC_REQUIRE([HW_HEADER_VARARGS_H])dnl Our check evaluates HAVE_VARARGS_H.
+  AC_CACHE_CHECK([for va_copy],
+    [hw_cv_func_va_copy],
+    [AC_RUN_IFELSE(
+      [AC_LANG_PROGRAM(
+        [[#if HAVE_STDARG_H
+        #include <stdarg.h>
+        #elif HAVE_VARARGS_H
+        #include <varargs.h>
+        #endif]],
+        [[va_list ap, aq; va_copy(aq, ap);]])],
+      [hw_cv_func_va_copy=yes],
+      [hw_cv_func_va_copy=no],
+      [hw_cv_func_va_copy=no])])
+  AS_IF([test "$hw_cv_func_va_copy" = yes],
+    [AC_DEFINE([HAVE_VA_COPY], [1],
+      [Define to 1 if you have the `va_copy' function or macro.])])
+])# HW_FUNC_VA_COPY
+
+# HW_FUNC___VA_COPY
+# -----------------
+# Set $hw_cv_func___va_copy to "yes" or "no".  Define HAVE___VA_COPY to 1 if
+# $hw_cv_func___va_copy is set to "yes".
+AC_DEFUN([HW_FUNC___VA_COPY],
+[
+  AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+  AC_REQUIRE([HW_HEADER_VARARGS_H])dnl Our check evaluates HAVE_VARARGS_H.
+  AC_CACHE_CHECK([for __va_copy],
+    [hw_cv_func___va_copy],
+    [AC_RUN_IFELSE(
+      [AC_LANG_PROGRAM(
+        [[#if HAVE_STDARG_H
+        #include <stdarg.h>
+        #elif HAVE_VARARGS_H
+        #include <varargs.h>
+        #endif]],
+        [[va_list ap, aq; __va_copy(aq, ap);]])],
+      [hw_cv_func___va_copy=yes],
+      [hw_cv_func___va_copy=no],
+      [hw_cv_func___va_copy=no])])
+  AS_IF([test "$hw_cv_func___va_copy" = yes],
+    [AC_DEFINE([HAVE___VA_COPY], [1],
+      [Define to 1 if you have the `__va_copy' function or macro.])])
+])# HW_FUNC___VA_COPY
+
+# HW_FUNC_VSNPRINTF
+# -----------------
+# Set $hw_cv_func_vsnprintf and $hw_cv_func_vsnprintf_c99 to "yes" or "no",
+# respectively.  Define HAVE_VSNPRINTF to 1 only if $hw_cv_func_vsnprintf_c99
+# is set to "yes".  Otherwise, define vsnprintf to rpl_vsnprintf and make sure
+# the replacement function will be built.
+AC_DEFUN([HW_FUNC_VSNPRINTF],
+[
+  AC_PREREQ([2.60])dnl 2.59 should work if some AC_TYPE_* macros are replaced.
+  AC_REQUIRE([HW_HEADER_STDARG_H])dnl Our check evaluates HAVE_STDARG_H.
+  AC_CHECK_FUNC([vsnprintf],
+    [hw_cv_func_vsnprintf=yes],
+    [hw_cv_func_vsnprintf=no])
+  AS_IF([test "$hw_cv_func_vsnprintf" = yes],
+    [AC_CACHE_CHECK([whether vsnprintf is C99 compliant],
+      [hw_cv_func_vsnprintf_c99],
+      [AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM(
+          [[#if HAVE_STDARG_H
+          #include <stdarg.h>
+          #endif
+          #include <stdio.h>
+          static int testprintf(char *buf, size_t size, const char *format, ...)
+          {
+            int result;
+            va_list ap;
+            va_start(ap, format);
+            result = vsnprintf(buf, size, format, ap);
+            va_end(ap);
+            return result;
+          }]],
+          [[char buf[43];
+          if (testprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+              testprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+              buf[0] != 'T' || buf[3] != '\0')
+            return 1;]])],
+        [hw_cv_func_vsnprintf_c99=yes],
+        [hw_cv_func_vsnprintf_c99=no],
+        [hw_cv_func_vsnprintf_c99=no])])],
+    [hw_cv_func_snprintf_c99=no])
+  AS_IF([test "$hw_cv_func_vsnprintf_c99" = yes],
+    [AC_DEFINE([HAVE_VSNPRINTF], [1],
+      [Define to 1 if you have a C99 compliant `vsnprintf' function.])],
+    [AC_CHECK_HEADERS([inttypes.h locale.h stddef.h stdint.h])
+    AC_CHECK_MEMBERS([struct lconv.decimal_point, struct lconv.thousands_sep],
+      [], [], [#include <locale.h>])
+dnl ccache doesn't link correctly on HP-UX 11.00 when support for long double
+dnl is enabled.
+dnl    AC_TYPE_LONG_DOUBLE
+    AC_TYPE_LONG_LONG_INT
+    AC_TYPE_UNSIGNED_LONG_LONG_INT
+    AC_TYPE_SIZE_T
+    AC_TYPE_INTMAX_T
+    AC_TYPE_UINTMAX_T
+    AC_TYPE_UINTPTR_T
+    AC_CHECK_TYPES([ptrdiff_t])
+    AC_CHECK_FUNCS([localeconv])
+    _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_VSNPRINTF
+
+# HW_FUNC_SNPRINTF
+# ----------------
+# Set $hw_cv_func_snprintf and $hw_cv_func_snprintf_c99 to "yes" or "no",
+# respectively.  Define HAVE_SNPRINTF to 1 only if $hw_cv_func_snprintf_c99
+# is set to "yes".  Otherwise, define snprintf to rpl_snprintf and make sure
+# the replacement function will be built.
+AC_DEFUN([HW_FUNC_SNPRINTF],
+[
+  AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl Our snprintf(3) calls vsnprintf(3).
+  AC_CHECK_FUNC([snprintf],
+    [hw_cv_func_snprintf=yes],
+    [hw_cv_func_snprintf=no])
+  AS_IF([test "$hw_cv_func_snprintf" = yes],
+    [AC_CACHE_CHECK([whether snprintf is C99 compliant],
+      [hw_cv_func_snprintf_c99],
+      [AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM([[#include <stdio.h>]],
+          [[char buf[43];
+          if (snprintf(buf, 4, "The answer is %27.2g.", 42.0) != 42 ||
+              snprintf(buf, 0, "No, it's %32zu.", (size_t)42) != 42 ||
+              buf[0] != 'T' || buf[3] != '\0')
+            return 1;]])],
+        [hw_cv_func_snprintf_c99=yes],
+        [hw_cv_func_snprintf_c99=no],
+        [hw_cv_func_snprintf_c99=no])])],
+    [hw_cv_func_snprintf_c99=no])
+  AS_IF([test "$hw_cv_func_snprintf_c99" = yes],
+    [AC_DEFINE([HAVE_SNPRINTF], [1],
+      [Define to 1 if you have a C99 compliant `snprintf' function.])],
+    [_HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_SNPRINTF
+
+# HW_FUNC_VASPRINTF
+# -----------------
+# Set $hw_cv_func_vasprintf to "yes" or "no".  Define HAVE_VASPRINTF to 1 if
+# $hw_cv_func_vasprintf is set to "yes".  Otherwise, define vasprintf to
+# rpl_vasprintf and make sure the replacement function will be built.
+AC_DEFUN([HW_FUNC_VASPRINTF],
+[
+  AC_REQUIRE([HW_FUNC_VSNPRINTF])dnl Our vasprintf(3) calls vsnprintf(3).
+  AC_CHECK_FUNCS([vasprintf],
+    [hw_cv_func_vasprintf=yes],
+    [hw_cv_func_vasprintf=no])
+  AS_IF([test "$hw_cv_func_vasprintf" = no],
+    [AC_CHECK_HEADERS([stdlib.h])
+    HW_FUNC_VA_COPY
+    AS_IF([test "$hw_cv_func_va_copy" = no],
+      [HW_FUNC___VA_COPY])
+    _HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_VASPRINTF
+
+# HW_FUNC_ASPRINTF
+# ----------------
+# Set $hw_cv_func_asprintf to "yes" or "no".  Define HAVE_ASPRINTF to 1 if
+# $hw_cv_func_asprintf is set to "yes".  Otherwise, define asprintf to
+# rpl_asprintf and make sure the replacement function will be built.
+AC_DEFUN([HW_FUNC_ASPRINTF],
+[
+  AC_REQUIRE([HW_FUNC_VASPRINTF])dnl Our asprintf(3) calls vasprintf(3).
+  AC_CHECK_FUNCS([asprintf],
+    [hw_cv_func_asprintf=yes],
+    [hw_cv_func_asprintf=no])
+  AS_IF([test "$hw_cv_func_asprintf" = no],
+    [_HW_FUNC_XPRINTF_REPLACE])
+])# HW_FUNC_ASPRINTF
+
+# _HW_FUNC_XPRINTF_REPLACE
+# ------------------------
+# Arrange for building snprintf.c.  Must be called if one or more of the
+# functions provided by snprintf.c are needed.
+AC_DEFUN([_HW_FUNC_XPRINTF_REPLACE],
+[
+  AS_IF([test "x$_hw_cv_func_xprintf_replace_done" != xyes],
+    [AC_C_CONST
+    HW_HEADER_STDARG_H
+    AC_LIBOBJ([snprintf])
+    _hw_cv_func_xprintf_replace_done=yes])
+])# _HW_FUNC_XPRINTF_REPLACE
+
+dnl vim: set joinspaces textwidth=80:
index 43d0def..43ee01f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 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
@@ -380,17 +380,14 @@ verify_object(struct conf *conf, struct manifest *mf, struct object *obj,
               struct hashtable *stated_files, struct hashtable *hashed_files)
 {
        uint32_t i;
-       struct file_info *fi;
        struct file_hash *actual;
-       struct file_stats *st;
        struct mdfour hash;
        int result;
-       char *path;
 
        for (i = 0; i < obj->n_file_info_indexes; i++) {
-               fi = &mf->file_infos[obj->file_info_indexes[i]];
-               path = mf->files[fi->index];
-               st = hashtable_search(hashed_files, path);
+               struct file_info *fi = &mf->file_infos[obj->file_info_indexes[i]];
+               char *path = mf->files[fi->index];
+               struct file_stats *st = hashtable_search(stated_files, path);
                if (!st) {
                        struct stat file_stat;
                        if (x_stat(path, &file_stat) != 0) {
@@ -555,8 +552,6 @@ add_file_info_indexes(uint32_t *indexes, uint32_t size,
 {
        struct hashtable_itr *iter;
        uint32_t i;
-       char *path;
-       struct file_hash *file_hash;
        struct hashtable *mf_files; /* path --> index */
        struct hashtable *mf_file_infos; /* struct file_info --> index */
 
@@ -569,8 +564,8 @@ add_file_info_indexes(uint32_t *indexes, uint32_t size,
        iter = hashtable_iterator(included_files);
        i = 0;
        do {
-               path = hashtable_iterator_key(iter);
-               file_hash = hashtable_iterator_value(iter);
+               char *path = hashtable_iterator_key(iter);
+               struct file_hash *file_hash = hashtable_iterator_value(iter);
                indexes[i] = get_file_hash_index(mf, path, file_hash, mf_files,
                                                 mf_file_infos);
                i++;
diff --git a/stats.c b/stats.c
index 2d35ec9..5f21765 100644 (file)
--- a/stats.c
+++ b/stats.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002-2004 Andrew Tridgell
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 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
@@ -110,11 +110,10 @@ parse_stats(struct counters *counters, const char *buf)
        size_t i = 0;
        const char *p;
        char *p2;
-       long val;
 
        p = buf;
        while (true) {
-               val = strtol(p, &p2, 10);
+               long val = strtol(p, &p2, 10);
                if (p2 == p) {
                        break;
                }
index df344c5..780d64f 100644 (file)
@@ -116,7 +116,7 @@ TEST(conf_read_valid_config)
          "read_only_direct = true\n"
          "recache = true\n"
          "run_second_cpp = true\n"
-         "sloppiness =     file_macro   ,time_macros,  include_file_mtime,include_file_ctime,file_stat_matches  pch_defines  \n"
+         "sloppiness =     file_macro   ,time_macros,  include_file_mtime,include_file_ctime,file_stat_matches, pch_defines  \n"
          "stats = false\n"
          "temporary_dir = ${USER}_foo\n"
          "umask = 777\n"
@@ -369,7 +369,7 @@ TEST(conf_print_items)
                true,
                SLOPPY_FILE_MACRO|SLOPPY_INCLUDE_FILE_MTIME|
                SLOPPY_INCLUDE_FILE_CTIME|SLOPPY_TIME_MACROS|
-               SLOPPY_FILE_STAT_MATCHES,
+               SLOPPY_FILE_STAT_MATCHES|SLOPPY_PCH_DEFINES,
                false,
                "td",
                022,
@@ -408,7 +408,8 @@ TEST(conf_print_items)
        CHECK_STR_EQ("recache = true", received_conf_items[n++].descr);
        CHECK_STR_EQ("run_second_cpp = true", received_conf_items[n++].descr);
        CHECK_STR_EQ("sloppiness = file_macro, include_file_mtime,"
-                    " include_file_ctime, time_macros, file_stat_matches",
+                    " include_file_ctime, time_macros, pch_defines,"
+                    " file_stat_matches",
                     received_conf_items[n++].descr);
        CHECK_STR_EQ("stats = false", received_conf_items[n++].descr);
        CHECK_STR_EQ("temporary_dir = td", received_conf_items[n++].descr);
diff --git a/util.c b/util.c
index 739e3af..ce1341c 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002 Andrew Tridgell
- * Copyright (C) 2009-2015 Joel Rosdahl
+ * Copyright (C) 2009-2016 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
@@ -66,12 +66,12 @@ static void
 log_prefix(bool log_updated_time)
 {
 #ifdef HAVE_GETTIMEOFDAY
-       char timestamp[100];
-       struct timeval tv;
-       struct tm *tm;
        static char prefix[200];
 
        if (log_updated_time) {
+               char timestamp[100];
+               struct tm *tm;
+               struct timeval tv;
                gettimeofday(&tv, NULL);
 #ifdef __MINGW64_VERSION_MAJOR
                tm = localtime((time_t *)&tv.tv_sec);
@@ -219,9 +219,9 @@ copy_fd(int fd_in, int fd_out)
        }
 
        while ((n = gzread(gz_in, buf, sizeof(buf))) > 0) {
-               ssize_t count, written = 0;
+               ssize_t written = 0;
                do {
-                       count = write(fd_out, buf + written, n - written);
+                       ssize_t count = write(fd_out, buf + written, n - written);
                        if (count == -1) {
                                if (errno != EAGAIN && errno != EINTR) {
                                        fatal("Failed to copy fd");
@@ -327,10 +327,9 @@ copy_file(const char *src, const char *dest, int compress_level)
                if (compress_level > 0) {
                        written = gzwrite(gz_out, buf, n);
                } else {
-                       ssize_t count;
                        written = 0;
                        do {
-                               count = write(fd_out, buf + written, n - written);
+                               ssize_t count = write(fd_out, buf + written, n - written);
                                if (count == -1 && errno != EINTR) {
                                        saved_errno = errno;
                                        break;
@@ -627,7 +626,7 @@ format_hash_as_string(const unsigned char *hash, int size)
                sprintf(&ret[i*2], "%02x", (unsigned) hash[i]);
        }
        if (size >= 0) {
-               sprintf(&ret[i*2], "-%u", size);
+               sprintf(&ret[i*2], "-%d", size);
        }
 
        return ret;
@@ -882,7 +881,7 @@ traverse(const char *dir, void (*fn)(const char *, struct stat *))
 
                fname = format("%s/%s", dir, de->d_name);
                if (lstat(fname, &st)) {
-                       if (errno != ENOENT) {
+                       if (errno != ENOENT && errno != ESTALE) {
                                fatal("lstat %s failed: %s", fname, strerror(errno));
                        }
                        free(fname);
@@ -1086,7 +1085,7 @@ x_realpath(const char *path)
 {
        long maxlen = path_max(path);
        char *ret, *p;
-#ifdef _WIN32
+#if !defined(HAVE_REALPATH) && defined(_WIN32)
        HANDLE path_handle;
 #endif
 
@@ -1180,15 +1179,16 @@ create_tmp_fd(char **fname)
        char *template = format("%s.%s", *fname, tmp_string());
        int fd = mkstemp(template);
        if (fd == -1 && errno == ENOENT) {
-               if (create_parent_dirs(template) != 0) {
+               if (create_parent_dirs(*fname) != 0) {
                        fatal("Failed to create directory %s: %s",
-                             dirname(template), strerror(errno));
+                             dirname(*fname), strerror(errno));
                }
                reformat(&template, "%s.%s", *fname, tmp_string());
                fd = mkstemp(template);
        }
        if (fd == -1) {
-               fatal("Failed to create file %s: %s", template, strerror(errno));
+               fatal("Failed to create temporary file for %s: %s",
+                     *fname, strerror(errno));
        }
 
 #ifndef _WIN32
@@ -1215,16 +1215,6 @@ create_tmp_file(char **fname, const char *mode)
 }
 
 /*
- * Create an empty temporary file. *fname will be reallocated and set to the
- * resulting filename.
- */
-void
-create_empty_tmp_file(char **fname)
-{
-       close(create_tmp_fd(fname));
-}
-
-/*
  * Return current user's home directory, or NULL if it can't be determined.
  */
 const char *
@@ -1339,7 +1329,6 @@ get_relative_path(const char *from, const char *to)
 {
        size_t common_prefix_len;
        int i;
-       const char *p;
        char *result;
 
        assert(from && is_absolute_path(from));
@@ -1359,6 +1348,7 @@ get_relative_path(const char *from, const char *to)
        result = x_strdup("");
        common_prefix_len = common_dir_prefix_length(from, to);
        if (common_prefix_len > 0 || !str_eq(from, "/")) {
+               const char *p;
                for (p = from + common_prefix_len; *p; p++) {
                        if (*p == '/') {
                                reformat(&result, "../%s", result);
@@ -1520,7 +1510,7 @@ x_unlink(const char *path)
        }
        if (unlink(tmp_name) == -1) {
                /* If it was released in a race, that's OK. */
-               if (errno != ENOENT) {
+               if (errno != ENOENT && errno != ESTALE) {
                        result = -1;
                        saved_errno = errno;
                }
index 710ffe5..0ccc6e5 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.2.4";
+const char CCACHE_VERSION[] = "3.2.5";