diff options
| -rw-r--r-- | apt-pkg/contrib/gpgv.cc | 2 | ||||
| -rw-r--r-- | apt-pkg/contrib/gpgv.h | 10 | ||||
| -rw-r--r-- | apt-pkg/contrib/macros.h | 7 | ||||
| -rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 2 | ||||
| -rw-r--r-- | cmdline/apt-internal-planner.cc | 2 | ||||
| -rw-r--r-- | cmdline/apt-internal-solver.cc | 2 | ||||
| -rw-r--r-- | methods/basehttp.h | 2 |
7 files changed, 15 insertions, 12 deletions
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc index 48d31a44c..59301fa0c 100644 --- a/apt-pkg/contrib/gpgv.cc +++ b/apt-pkg/contrib/gpgv.cc @@ -290,7 +290,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG, bool const Debug = _config->FindB("Debug::Acquire::gpgv", false); struct exiter { std::vector<std::string> files; - void operator ()(int code) APT_NORETURN { + [[noreturn]] void operator ()(int code) { std::for_each(files.begin(), files.end(), [](auto f) { unlink(f.c_str()); }); exit(code); diff --git a/apt-pkg/contrib/gpgv.h b/apt-pkg/contrib/gpgv.h index 0b84f6bb7..f4f0a2ac7 100644 --- a/apt-pkg/contrib/gpgv.h +++ b/apt-pkg/contrib/gpgv.h @@ -47,11 +47,11 @@ APT_PUBLIC std::pair<std::string, std::forward_list<std::string>> FindGPGV(bool * @param fd is used as a pipe for the standard output of gpgv * @param key is the specific one to be used instead of using all */ -APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, - int const &statusfd, int fd[2], std::vector<std::string> const &KeyFiles) APT_NORETURN; -APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, - int const &statusfd, int fd[2], std::string const &Key = "") APT_NORETURN; -inline APT_NORETURN void ExecGPGV(std::string const &File, std::string const &FileSig, +[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, + int const &statusfd, int fd[2], std::vector<std::string> const &KeyFiles); +[[noreturn]] APT_PUBLIC void ExecGPGV(std::string const &File, std::string const &FileSig, + int const &statusfd, int fd[2], std::string const &Key = ""); +[[noreturn]] inline void ExecGPGV(std::string const &File, std::string const &FileSig, int const &statusfd = -1) { int fd[2]; ExecGPGV(File, FileSig, statusfd, fd); diff --git a/apt-pkg/contrib/macros.h b/apt-pkg/contrib/macros.h index db4932969..c1fa73775 100644 --- a/apt-pkg/contrib/macros.h +++ b/apt-pkg/contrib/macros.h @@ -40,7 +40,6 @@ #define APT_DEPRECATED_MSG(X) __attribute__ ((deprecated(X))) // __attribute__((const)) is too dangerous for us, we end up using it wrongly #define APT_PURE __attribute__((pure)) - #define APT_NORETURN __attribute__((noreturn)) #define APT_PRINTF(n) __attribute__((format(printf, n, n + 1))) #define APT_WEAK __attribute__((weak)); #define APT_UNUSED __attribute__((unused)) @@ -48,7 +47,6 @@ #define APT_DEPRECATED #define APT_DEPRECATED_MSG #define APT_PURE - #define APT_NORETURN #define APT_PRINTF(n) #define APT_WEAK #define APT_UNUSED @@ -136,6 +134,11 @@ AptScopeWrapper(F) -> AptScopeWrapper<F>; #define SETFLAG(v,f) ((v) |= FLAG(f)) #define CLRFLAG(v,f) ((v) &=~FLAG(f)) #define CHKFLAG(v,f) ((v) & FLAG(f) ? true : false) +#if APT_GCC_VERSION >= 0x0300 + #define APT_NORETURN __attribute__((noreturn)) +#else + #define APT_NORETURN +#endif #endif #endif #endif diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 8cadd2712..d176e85fc 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1488,7 +1488,7 @@ public: auto begin() const { return args.cbegin(); } auto end() const { return args.cend(); } auto& front() const { return args.front(); } - APT_NORETURN void execute(char const *const errmsg) { + [[noreturn]] void execute(char const *const errmsg) { args.push_back(nullptr); execvp(args.front(), &args.front()); std::cerr << errmsg << std::endl; diff --git a/cmdline/apt-internal-planner.cc b/cmdline/apt-internal-planner.cc index abd2a7be9..b850ed628 100644 --- a/cmdline/apt-internal-planner.cc +++ b/cmdline/apt-internal-planner.cc @@ -51,7 +51,7 @@ static bool ShowHelp(CommandLine &) /*{{{*/ return true; } /*}}}*/ -APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ +[[noreturn]] static void DIE(std::string const &message) { /*{{{*/ std::cerr << "ERROR: " << message << std::endl; _error->DumpErrors(std::cerr); exit(EXIT_FAILURE); diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc index d596dcb5e..ceedd96c7 100644 --- a/cmdline/apt-internal-solver.cc +++ b/cmdline/apt-internal-solver.cc @@ -51,7 +51,7 @@ static bool ShowHelp(CommandLine &) /*{{{*/ return true; } /*}}}*/ -APT_NORETURN static void DIE(std::string const &message) { /*{{{*/ +[[noreturn]] static void DIE(std::string const &message) { /*{{{*/ std::cerr << "ERROR: " << message << std::endl; _error->DumpErrors(std::cerr); exit(EXIT_FAILURE); diff --git a/methods/basehttp.h b/methods/basehttp.h index ee4a84d3d..1d3ed1ace 100644 --- a/methods/basehttp.h +++ b/methods/basehttp.h @@ -163,7 +163,7 @@ class BaseHttpMethod : public aptAuthConfMethod static std::string FailFile; static int FailFd; static time_t FailTime; - static APT_NORETURN void SigTerm(int); + [[noreturn]] static void SigTerm(int); int Loop(); |
