- Added support for caching `.su` files generated by GCC flag `-fstack-usage`.
+- Configuration errors are now treated as warnings instead of fatal errors.
+
ccache 3.3.3
------------
secondary_config_path = format("%s/ccache.conf", TO_STRING(SYSCONFDIR));
if (!conf_read(conf, secondary_config_path, &errmsg)) {
if (stat(secondary_config_path, &st) == 0) {
- fatal("%s", errmsg);
+ warn("%s", errmsg);
}
// Missing config file in SYSCONFDIR is OK.
free(errmsg);
bool should_create_initial_config = false;
if (!conf_read(conf, primary_config_path, &errmsg)) {
if (stat(primary_config_path, &st) == 0) {
- fatal("%s", errmsg);
+ warn("%s", errmsg);
}
should_create_initial_config = true;
}
if (!conf_update_from_environment(conf, &errmsg)) {
- fatal("%s", errmsg);
+ warn("%s", errmsg);
}
if (conf->disable) {
void cc_bulklog(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
void cc_log_argv(const char *prefix, char **argv);
void fatal(const char *format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN;
+void warn(const char *format, ...) ATTR_FORMAT(printf, 1, 2);
void copy_fd(int fd_in, int fd_out);
int copy_file(const char *src, const char *dest, int compress_level);
// Copyright (C) 2002 Andrew Tridgell
-// Copyright (C) 2009-2016 Joel Rosdahl
+// Copyright (C) 2009-2017 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
x_exit(1);
}
+void
+warn(const char *format, ...)
+{
+ va_list ap;
+ va_start(ap, format);
+ char msg[1000];
+ vsnprintf(msg, sizeof(msg), format, ap);
+ va_end(ap);
+
+ cc_log("WARNING: %s", msg);
+ fprintf(stderr, "ccache: warning: %s\n", msg);
+}
+
// Copy all data from fd_in to fd_out, decompressing data from fd_in if needed.
void
copy_fd(int fd_in, int fd_out)