-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
+ -readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,
#include "Util.hpp"
-#include "Config.hpp"
#include "Context.hpp"
#include <Config.hpp>
#ifdef _WIN32
const std::string compiler_path = util::add_exe_suffix(args[0]);
#else
- const std::string compiler_path = args[0];
+ const std::string& compiler_path = args[0];
#endif
DirEntry dir_entry(compiler_path, DirEntry::LogOnError::yes);
#include <util/fmtmacros.hpp>
// The option it too hard to handle at all.
-#define TOO_HARD (1 << 0)
+int TOO_HARD = 1 << 0;
// The option it too hard for the direct mode.
-#define TOO_HARD_DIRECT (1 << 1)
+int TOO_HARD_DIRECT = 1 << 1;
// The option takes a separate argument, e.g. "-D FOO=1".
-#define TAKES_ARG (1 << 2)
+int TAKES_ARG = 1 << 2;
// The option takes a concatenated argument, e.g. "-DFOO=1".
-#define TAKES_CONCAT_ARG (1 << 3)
+int TAKES_CONCAT_ARG = 1 << 3;
// The argument to the option is a path that may be rewritten if base_dir is
// used.
-#define TAKES_PATH (1 << 4)
+int TAKES_PATH = 1 << 4;
// The option only affects preprocessing; not passed to the compiler if
// run_second_cpp is false.
-#define AFFECTS_CPP (1 << 5)
+int AFFECTS_CPP = 1 << 5;
// The option only affects compilation; not passed to the preprocessor.
-#define AFFECTS_COMP (1 << 6)
+int AFFECTS_COMP = 1 << 6;
struct CompOpt
{
#include "ResultRetriever.hpp"
-#include "Context.hpp"
#include "Depfile.hpp"
#include <Context.hpp>
-// Copyright (C) 2020-2023 Joel Rosdahl and other contributors
+// Copyright (C) 2020-2024 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
// [1]: <https://github.com/Alexpux/mingw-w64/blob/
// d0d7f784833bbb0b2d279310ddc6afb52fe47a46/mingw-w64-crt/misc/mkstemp.c>
- Fd fd(bsd_mkstemps(&path_template[0], static_cast<int>(suffix.length())));
+ Fd fd(bsd_mkstemps(path_template.data(), static_cast<int>(suffix.length())));
#else
- Fd fd(mkstemps(&path_template[0], static_cast<int>(suffix.length())));
+ Fd fd(mkstemps(path_template.data(), static_cast<int>(suffix.length())));
#endif
if (!fd) {
return tl::unexpected(FMT("failed to create temporary file for {}: {}",
-// Copyright (C) 2021-2023 Joel Rosdahl and other contributors
+// Copyright (C) 2021-2024 Joel Rosdahl and other contributors
//
// See doc/AUTHORS.adoc for a complete list of contributors.
//
#endif
#ifdef HAVE_UTIMENSAT
-# include <fcntl.h>
-# include <sys/stat.h>
#elif defined(HAVE_UTIMES)
# include <sys/time.h>
#else
-# include <sys/types.h>
# ifdef HAVE_UTIME_H
# include <utime.h>
# elif defined(HAVE_SYS_UTIME_H)
readability-*,
-readability-else-after-return,
-readability-function-cognitive-complexity,
+ -readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-magic-numbers,
-readability-named-parameter,