*time_macros*::
Ignore `+__DATE__+`, `+__TIME__+` and `+__TIMESTAMP__+` being present in the
source code.
+*random_seed*::
+ By default, ccache will respect argument changes with `-frandom-seed`. This
+ sloppiness will allow cache hits even if the seed value is different.
--
+
See the discussion under _<<Troubleshooting>>_ for more information.
result.enable(core::Sloppy::modules);
} else if (token == "pch_defines") {
result.enable(core::Sloppy::pch_defines);
+ } else if (token == "random_seed") {
+ result.enable(core::Sloppy::random_seed);
} else if (token == "system_headers" || token == "no_system_headers") {
result.enable(core::Sloppy::system_headers);
} else if (token == "time_macros") {
if (sloppiness.is_enabled(core::Sloppy::pch_defines)) {
result += "pch_defines, ";
}
+ if (sloppiness.is_enabled(core::Sloppy::random_seed)) {
+ result += "random_seed, ";
+ }
if (sloppiness.is_enabled(core::Sloppy::system_headers)) {
result += "system_headers, ";
}
return {};
}
+ // If we treat random_seed sloppily we ignore the argument when
+ // hashing.
+ if (util::starts_with(args[i], "-frandom-seed=")
+ && ctx.config.sloppiness().is_enabled(core::Sloppy::random_seed)) {
+ hash.hash_delimiter("arg");
+ hash.hash("-frandom-seed=");
+ return {};
+ }
+
// When using the preprocessor, some arguments don't contribute to the hash.
// The theory is that these arguments will change the output of -E if they are
// going to have any effect at all. For precompiled headers this might not be
ivfsoverlay = 1U << 10,
// Allow us to include incorrect working directory in .gcno files.
gcno_cwd = 1U << 11,
+ // Ignore changes in -frandom-seed
+ random_seed = 1U << 12,
};
class Sloppiness