Skip to content

parser/libapparmor_re: remove unnecessary throw(int)

Eric Chiang requested to merge ericchiang/apparmor:throw into master

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

Signed-off-by: Eric Chiang ericchiang@google.com

Edited by Eric Chiang

Merge request reports