summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/contrib/gpgv.cc2
-rw-r--r--apt-pkg/contrib/gpgv.h10
-rw-r--r--apt-pkg/contrib/macros.h7
-rw-r--r--apt-pkg/deb/dpkgpm.cc2
4 files changed, 12 insertions, 9 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;