change. The list separator is semicolon on Windows systems and colon on
other systems.
+*keep_comments_cpp* (*CCACHE_COMMENTS*) [boolean]::
+
+ If true, ccache will not discard the comments before hashing preprocessor
+ output. This can be used to check documentation with *-Wdocumentation*.
+
*log_file* (*CCACHE_LOGFILE*)::
If set to a file path, ccache will write information on what it is doing to
add_pending_tmp_file(path_stdout);
args_add(args, "-E");
+ if (conf->keep_comments_cpp)
+ args_add(args, "-C");
args_add(args, input_file);
add_prefix(args, conf->prefix_command_cpp);
cc_log("Running preprocessor");
conf->hard_link = false;
conf->hash_dir = false;
conf->ignore_headers_in_manifest = x_strdup("");
+ conf->keep_comments_cpp = false;
conf->log_file = x_strdup("");
conf->max_files = 0;
conf->max_size = (uint64_t)5 * 1000 * 1000 * 1000;
conf->item_origins[find_conf("ignore_headers_in_manifest")->number],
context);
+ reformat(&s, "keep_comments_cpp = %s", bool_to_string(conf->keep_comments_cpp));
+ printer(s, conf->item_origins[find_conf("keep_comments_cpp")->number], context);
+
reformat(&s, "log_file = %s", conf->log_file);
printer(s, conf->item_origins[find_conf("log_file")->number], context);
bool hard_link;
bool hash_dir;
char *ignore_headers_in_manifest;
+ bool keep_comments_cpp;
char *log_file;
unsigned max_files;
uint64_t max_size;
hard_link, 11, ITEM(hard_link, bool)
hash_dir, 12, ITEM(hash_dir, bool)
ignore_headers_in_manifest, 13, ITEM(ignore_headers_in_manifest, env_string)
-log_file, 14, ITEM(log_file, env_string)
-max_files, 15, ITEM(max_files, unsigned)
-max_size, 16, ITEM(max_size, size)
-path, 17, ITEM(path, env_string)
-prefix_command, 18, ITEM(prefix_command, env_string)
-prefix_command_cpp, 19, ITEM(prefix_command_cpp, env_string)
-read_only, 20, ITEM(read_only, bool)
-read_only_direct, 21, ITEM(read_only_direct, bool)
-recache, 22, ITEM(recache, bool)
-run_second_cpp, 23, ITEM(run_second_cpp, bool)
-sloppiness, 24, ITEM(sloppiness, sloppiness)
-stats, 25, ITEM(stats, bool)
-temporary_dir, 26, ITEM(temporary_dir, env_string)
-umask, 27, ITEM(umask, umask)
-unify, 28, ITEM(unify, bool)
+keep_comments_cpp, 14, ITEM(keep_comments_cpp, bool)
+log_file, 15, ITEM(log_file, env_string)
+max_files, 16, ITEM(max_files, unsigned)
+max_size, 17, ITEM(max_size, size)
+path, 18, ITEM(path, env_string)
+prefix_command, 19, ITEM(prefix_command, env_string)
+prefix_command_cpp, 20, ITEM(prefix_command_cpp, env_string)
+read_only, 21, ITEM(read_only, bool)
+read_only_direct, 22, ITEM(read_only_direct, bool)
+recache, 23, ITEM(recache, bool)
+run_second_cpp, 24, ITEM(run_second_cpp, bool)
+sloppiness, 25, ITEM(sloppiness, sloppiness)
+stats, 26, ITEM(stats, bool)
+temporary_dir, 27, ITEM(temporary_dir, env_string)
+umask, 28, ITEM(umask, umask)
+unify, 29, ITEM(unify, bool)
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 0, 13, 0,
- 15, 10, 45, 5, 30, 10, 45, 45, 10, 20,
+ 15, 10, 45, 5, 30, 10, 45, 0, 10, 20,
5, 0, 0, 45, 5, 0, 10, 15, 45, 45,
15, 45, 45, 45, 45, 45, 45, 45, 45, 45,
45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
{
enum
{
- TOTAL_KEYWORDS = 29,
+ TOTAL_KEYWORDS = 30,
MIN_WORD_LENGTH = 4,
MAX_WORD_LENGTH = 26,
MIN_HASH_VALUE = 4,
{
{"",0,NULL,0,NULL}, {"",0,NULL,0,NULL},
{"",0,NULL,0,NULL}, {"",0,NULL,0,NULL},
-#line 27 "confitems.gperf"
- {"path", 17, ITEM(path, env_string)},
+#line 28 "confitems.gperf"
+ {"path", 18, ITEM(path, env_string)},
{"",0,NULL,0,NULL}, {"",0,NULL,0,NULL},
{"",0,NULL,0,NULL},
#line 13 "confitems.gperf"
{"cpp_extension", 7, ITEM(cpp_extension, string)},
#line 14 "confitems.gperf"
{"compiler_check", 4, ITEM(compiler_check, string)},
-#line 35 "confitems.gperf"
- {"stats", 25, ITEM(stats, bool)},
+#line 36 "confitems.gperf"
+ {"stats", 26, ITEM(stats, bool)},
#line 12 "confitems.gperf"
{"cache_dir_levels", 2, ITEM_V(cache_dir_levels, unsigned, dir_levels)},
#line 16 "confitems.gperf"
{"compression_level", 6, ITEM(compression_level, unsigned)},
-#line 24 "confitems.gperf"
- {"log_file", 14, ITEM(log_file, env_string)},
-#line 28 "confitems.gperf"
- {"prefix_command", 18, ITEM(prefix_command, env_string)},
-#line 34 "confitems.gperf"
- {"sloppiness", 24, ITEM(sloppiness, sloppiness)},
+#line 25 "confitems.gperf"
+ {"log_file", 15, ITEM(log_file, env_string)},
+#line 29 "confitems.gperf"
+ {"prefix_command", 19, ITEM(prefix_command, env_string)},
+#line 35 "confitems.gperf"
+ {"sloppiness", 25, ITEM(sloppiness, sloppiness)},
#line 10 "confitems.gperf"
{"base_dir", 0, ITEM_V(base_dir, env_string, absolute_path)},
-#line 32 "confitems.gperf"
- {"recache", 22, ITEM(recache, bool)},
-#line 29 "confitems.gperf"
- {"prefix_command_cpp", 19, ITEM(prefix_command_cpp, env_string)},
+#line 33 "confitems.gperf"
+ {"recache", 23, ITEM(recache, bool)},
#line 30 "confitems.gperf"
- {"read_only", 20, ITEM(read_only, bool)},
-#line 38 "confitems.gperf"
- {"unify", 28, ITEM(unify, bool)},
- {"",0,NULL,0,NULL}, {"",0,NULL,0,NULL},
+ {"prefix_command_cpp", 20, ITEM(prefix_command_cpp, env_string)},
+#line 31 "confitems.gperf"
+ {"read_only", 21, ITEM(read_only, bool)},
+#line 39 "confitems.gperf"
+ {"unify", 29, ITEM(unify, bool)},
+ {"",0,NULL,0,NULL},
+#line 24 "confitems.gperf"
+ {"keep_comments_cpp", 14, ITEM(keep_comments_cpp, bool)},
+#line 27 "confitems.gperf"
+ {"max_size", 17, ITEM(max_size, size)},
#line 26 "confitems.gperf"
- {"max_size", 16, ITEM(max_size, size)},
-#line 25 "confitems.gperf"
- {"max_files", 15, ITEM(max_files, unsigned)},
+ {"max_files", 16, ITEM(max_files, unsigned)},
{"",0,NULL,0,NULL},
-#line 31 "confitems.gperf"
- {"read_only_direct", 21, ITEM(read_only_direct, bool)},
+#line 32 "confitems.gperf"
+ {"read_only_direct", 22, ITEM(read_only_direct, bool)},
#line 19 "confitems.gperf"
{"disable", 9, ITEM(disable, bool)},
-#line 36 "confitems.gperf"
- {"temporary_dir", 26, ITEM(temporary_dir, env_string)},
-#line 33 "confitems.gperf"
- {"run_second_cpp", 23, ITEM(run_second_cpp, bool)},
+#line 37 "confitems.gperf"
+ {"temporary_dir", 27, ITEM(temporary_dir, env_string)},
+#line 34 "confitems.gperf"
+ {"run_second_cpp", 24, ITEM(run_second_cpp, bool)},
{"",0,NULL,0,NULL},
#line 18 "confitems.gperf"
{"direct_mode", 8, ITEM(direct_mode, bool)},
{"hash_dir", 12, ITEM(hash_dir, bool)},
#line 21 "confitems.gperf"
{"hard_link", 11, ITEM(hard_link, bool)},
-#line 37 "confitems.gperf"
- {"umask", 27, ITEM(umask, umask)},
+#line 38 "confitems.gperf"
+ {"umask", 28, ITEM(umask, umask)},
#line 23 "confitems.gperf"
{"ignore_headers_in_manifest", 13, ITEM(ignore_headers_in_manifest, env_string)},
{"",0,NULL,0,NULL}, {"",0,NULL,0,NULL},
}
return 0;
}
-static const size_t CONFITEMS_TOTAL_KEYWORDS = 29;
+static const size_t CONFITEMS_TOTAL_KEYWORDS = 30;
COMPRESS, "compression"
COMPRESSLEVEL, "compression_level"
CPP2, "run_second_cpp"
+COMMENTS, "keep_comments_cpp"
DIR, "cache_dir"
DIRECT, "direct_mode"
DISABLE, "disable"
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 10, 0, 0, 10,
- 20, 44, 5, 15, 0, 44, 30, 25, 15, 0,
+ 0, 44, 5, 15, 0, 44, 30, 25, 3, 0,
5, 15, 5, 15, 0, 0, 44, 44, 44, 44,
0, 44, 44, 44, 44, 44, 44, 44, 44, 44,
44, 44, 44, 44, 44, 44, 44, 44, 44, 44,
{
enum
{
- TOTAL_KEYWORDS = 29,
+ TOTAL_KEYWORDS = 30,
MIN_WORD_LENGTH = 2,
MAX_WORD_LENGTH = 15,
MIN_HASH_VALUE = 2,
{"",""}, {"",""},
#line 12 "envtoconfitems.gperf"
{"CC", "compiler"},
-#line 17 "envtoconfitems.gperf"
+#line 18 "envtoconfitems.gperf"
{"DIR", "cache_dir"},
#line 16 "envtoconfitems.gperf"
{"CPP2", "run_second_cpp"},
-#line 39 "envtoconfitems.gperf"
+#line 40 "envtoconfitems.gperf"
{"UNIFY", "unify"},
-#line 18 "envtoconfitems.gperf"
- {"DIRECT", "direct_mode"},
#line 19 "envtoconfitems.gperf"
+ {"DIRECT", "direct_mode"},
+#line 20 "envtoconfitems.gperf"
{"DISABLE", "disable"},
- {"",""},
-#line 29 "envtoconfitems.gperf"
- {"PATH", "path"},
- {"",""},
+#line 17 "envtoconfitems.gperf"
+ {"COMMENTS", "keep_comments_cpp"},
#line 30 "envtoconfitems.gperf"
+ {"PATH", "path"},
+#line 29 "envtoconfitems.gperf"
+ {"NLEVELS", "cache_dir_levels"},
+#line 31 "envtoconfitems.gperf"
{"PREFIX", "prefix_command"},
-#line 34 "envtoconfitems.gperf"
+#line 35 "envtoconfitems.gperf"
{"RECACHE", "recache"},
#line 13 "envtoconfitems.gperf"
{"COMPILERCHECK", "compiler_check"},
{"",""},
-#line 31 "envtoconfitems.gperf"
+#line 32 "envtoconfitems.gperf"
{"PREFIX_CPP", "prefix_command_cpp"},
{"",""},
-#line 37 "envtoconfitems.gperf"
+#line 38 "envtoconfitems.gperf"
{"TEMPDIR", "temporary_dir"},
-#line 32 "envtoconfitems.gperf"
+#line 33 "envtoconfitems.gperf"
{"READONLY", "read_only"},
-#line 20 "envtoconfitems.gperf"
+#line 21 "envtoconfitems.gperf"
{"EXTENSION", "cpp_extension"},
-#line 36 "envtoconfitems.gperf"
+#line 37 "envtoconfitems.gperf"
{"STATS", "stats"},
{"",""},
-#line 23 "envtoconfitems.gperf"
+#line 24 "envtoconfitems.gperf"
{"HASHDIR", "hash_dir"},
#line 14 "envtoconfitems.gperf"
{"COMPRESS", "compression"},
{"",""},
-#line 33 "envtoconfitems.gperf"
+#line 34 "envtoconfitems.gperf"
{"READONLY_DIRECT", "read_only_direct"},
{"",""},
#line 11 "envtoconfitems.gperf"
#line 15 "envtoconfitems.gperf"
{"COMPRESSLEVEL", "compression_level"},
{"",""},
-#line 21 "envtoconfitems.gperf"
+#line 22 "envtoconfitems.gperf"
{"EXTRAFILES", "extra_files_to_hash"},
{"",""},
-#line 27 "envtoconfitems.gperf"
+#line 28 "envtoconfitems.gperf"
{"MAXSIZE", "max_size"},
-#line 26 "envtoconfitems.gperf"
+#line 27 "envtoconfitems.gperf"
{"MAXFILES", "max_files"},
{"",""},
-#line 38 "envtoconfitems.gperf"
+#line 39 "envtoconfitems.gperf"
{"UMASK", "umask"},
{"",""},
-#line 25 "envtoconfitems.gperf"
+#line 26 "envtoconfitems.gperf"
{"LOGFILE", "log_file"},
-#line 22 "envtoconfitems.gperf"
+#line 23 "envtoconfitems.gperf"
{"HARDLINK", "hard_link"},
{"",""},
-#line 35 "envtoconfitems.gperf"
+#line 36 "envtoconfitems.gperf"
{"SLOPPINESS", "sloppiness"},
- {"",""},
-#line 28 "envtoconfitems.gperf"
- {"NLEVELS", "cache_dir_levels"},
-#line 24 "envtoconfitems.gperf"
+ {"",""}, {"",""},
+#line 25 "envtoconfitems.gperf"
{"IGNOREHEADERS", "ignore_headers_in_manifest"}
};
}
return 0;
}
-static const size_t ENVTOCONFITEMS_TOTAL_KEYWORDS = 29;
+static const size_t ENVTOCONFITEMS_TOTAL_KEYWORDS = 30;
unset CCACHE_CC
unset CCACHE_COMPILERCHECK
unset CCACHE_COMPRESS
+unset CCACHE_COMMENTS
unset CCACHE_CPP2
unset CCACHE_DIR
unset CCACHE_DISABLE
#include "test/framework.h"
#include "test/util.h"
-#define N_CONFIG_ITEMS 29
+#define N_CONFIG_ITEMS 30
static struct {
char *descr;
const char *origin;
CHECK(!conf->hard_link);
CHECK(!conf->hash_dir);
CHECK_STR_EQ("", conf->ignore_headers_in_manifest);
+ CHECK(!conf->keep_comments_cpp);
CHECK_STR_EQ("", conf->log_file);
CHECK_INT_EQ(0, conf->max_files);
CHECK_INT_EQ((uint64_t)5 * 1000 * 1000 * 1000, conf->max_size);
"hard_link = true\n"
"hash_dir = true\n"
"ignore_headers_in_manifest = a:b/c\n"
+ "keep_comments_cpp = true\n"
"log_file = $USER${USER} \n"
"max_files = 17\n"
"max_size = 123M\n"
CHECK(conf->hard_link);
CHECK(conf->hash_dir);
CHECK_STR_EQ("a:b/c", conf->ignore_headers_in_manifest);
+ CHECK(conf->keep_comments_cpp);
CHECK_STR_EQ_FREE1(format("%s%s", user, user), conf->log_file);
CHECK_INT_EQ(17, conf->max_files);
CHECK_INT_EQ(123 * 1000 * 1000, conf->max_size);
true,
true,
"ihim",
+ true,
"lf",
4711,
98.7 * 1000 * 1000,
CHECK_STR_EQ("hash_dir = true", received_conf_items[n++].descr);
CHECK_STR_EQ("ignore_headers_in_manifest = ihim",
received_conf_items[n++].descr);
+ CHECK_STR_EQ("keep_comments_cpp = true", received_conf_items[n++].descr);
CHECK_STR_EQ("log_file = lf", received_conf_items[n++].descr);
CHECK_STR_EQ("max_files = 4711", received_conf_items[n++].descr);
CHECK_STR_EQ("max_size = 98.7M", received_conf_items[n++].descr);