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. This gets us closer to possibly enabling '-Werror'
in the future.

For example, the following program catches the exception without a
throw(int) annotation:

	#include <iostream>
	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

PR: https://gitlab.com/apparmor/apparmor/merge_requests/356
Signed-off-by: Eric Chiang <ericchiang@google.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
John Johansen 2019-03-21 08:07:48 +00:00
commit ad7ea230aa

View file

@ -44,7 +44,7 @@ typedef list<State *> 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;