From 48dcbb9dcb85eefecd2e60845ad12cf7f644babd Mon Sep 17 00:00:00 2001 From: Eric Chiang Date: Mon, 18 Mar 2019 10:57:05 -0700 Subject: [PATCH] parser/libapparmor_re: remove unnecessary throw(int) Compiling the parser currently prints a deprecation warning. Remove throw(int) annotations from function signatures. These aren't required to catch exceptions. For example, the following program catches the exception without a throw(int) annotation: #include void throw_an_error() { throw 3; return; } int main () { try { throw_an_error(); } catch (int e) { std::cout << "caught exception " << e << '\n'; } return 0; } This program prints: $ g++ -o error error.cc $ ./error caught exception 3 Signed-off-by: Eric Chiang --- parser/libapparmor_re/hfa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/libapparmor_re/hfa.h b/parser/libapparmor_re/hfa.h index f8fe3d31f..0a9820b34 100644 --- a/parser/libapparmor_re/hfa.h +++ b/parser/libapparmor_re/hfa.h @@ -44,7 +44,7 @@ typedef list Partition; class perms_t { public: - perms_t(void) throw(int): allow(0), deny(0), audit(0), quiet(0), exact(0) { }; + perms_t(void): allow(0), deny(0), audit(0), quiet(0), exact(0) { }; bool is_accept(void) { return (allow | audit | quiet); } @@ -192,7 +192,7 @@ struct DiffDag { */ class State { public: - State(int l, ProtoState &n, State *other) throw(int): + State(int l, ProtoState &n, State *other): label(l), flags(0), perms(), trans() { int error;