]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove now unused legacy format function
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 12:00:03 +0000 (14:00 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 12:12:36 +0000 (14:12 +0200)
src/legacy_util.cpp
src/legacy_util.hpp

index e3dce08149eefd2129931b93dc8de328e6e707ed..797265370bb03f943206e0e269eed01581b07242 100644 (file)
@@ -101,25 +101,6 @@ get_hostname()
   return hostname;
 }
 
-// Construct a string according to a format. Caller frees.
-char*
-format(const char* format, ...)
-{
-  va_list ap;
-  va_start(ap, format);
-
-  char* ptr = nullptr;
-  if (vasprintf(&ptr, format, ap) == -1) {
-    fatal("Out of memory in format");
-  }
-  va_end(ap);
-
-  if (!*ptr) {
-    fatal("Internal error in format");
-  }
-  return ptr;
-}
-
 // This is like setenv.
 void
 x_setenv(const char* name, const char* value)
index 74af3986b40b2082ccdd54bc554de51030873bf5..cee484d6e57b8564aa5f13e1da809fb6ccd6f623 100644 (file)
@@ -27,7 +27,6 @@ void fatal(const char* format, ...) ATTR_FORMAT(printf, 1, 2) ATTR_NORETURN;
 bool write_fd(int fd, const void* buf, size_t size);
 bool copy_fd(int fd_in, int fd_out);
 const char* get_hostname();
-char* format(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
 void x_setenv(const char* name, const char* value);
 void x_unsetenv(const char* name);
 #ifndef HAVE_LOCALTIME_R