diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-12-31 09:36:54 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:58 +0200 |
commit | 7cc5348a8b7495b8b79ed1830223bd3acd3c8aee (patch) | |
tree | 705ee9f078712245c34e3a5232b58b637870085c /src/Conf.cpp | |
parent | af6ab529bead084b32057053b88606ca69f5db3f (diff) |
Add error_on_warning option to allow turning compiler warnings to errors
Diffstat (limited to 'src/Conf.cpp')
-rw-r--r-- | src/Conf.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Conf.cpp b/src/Conf.cpp index 1962517..e3c894a 100644 --- a/src/Conf.cpp +++ b/src/Conf.cpp @@ -1067,6 +1067,24 @@ namespace sibs else throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".ignore_dirs to be a list, was a single value"); } + else if(name.equals("error_on_warning")) + { + if (value.isSingle()) + { + StringView value_str = value.asSingle(); + bool value_bool = false; + if(value_str.equals("true")) + value_bool = true; + else if(value_str.equals("false")) + value_bool = false; + else + throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".error_on_warning to be either true or false"); + + errorOnWarning = value_bool; + } + else + throw ParserException("Expected " + string(currentObject.data, currentObject.size) + ".error_on_warning to be a single value, was a list"); + } else failInvalidFieldUnderObject(name); } |