static/source/embindmaker/embindmaker.cxx | 2 +- unoidl/source/unoidl-check.cxx | 3 +-- unoidl/source/unoidl-read.cxx | 2 +- unoidl/source/unoidl-write.cxx | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-)
New commits: commit b26ff81a6f8f5ad99bba153cf57bef68fd03930d Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu May 2 09:01:34 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Thu May 2 13:21:40 2024 +0200 use [[noreturn]] instead of asserts that badUsage exits Change-Id: I927434290b02b6cc0386b1e0038cd8385a762249 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166996 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/static/source/embindmaker/embindmaker.cxx b/static/source/embindmaker/embindmaker.cxx index 0b7634cf8409..b696a09c6127 100644 --- a/static/source/embindmaker/embindmaker.cxx +++ b/static/source/embindmaker/embindmaker.cxx @@ -43,7 +43,7 @@ namespace { -void badUsage() +[[noreturn]] void badUsage() { std::cerr << "Usage: " diff --git a/unoidl/source/unoidl-check.cxx b/unoidl/source/unoidl-check.cxx index b2d57766f968..e836befbae13 100644 --- a/unoidl/source/unoidl-check.cxx +++ b/unoidl/source/unoidl-check.cxx @@ -72,7 +72,7 @@ static bool operator ==( namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << (" unoidl-check [--ignore-unpublished] [<extra registries A>]" @@ -106,7 +106,6 @@ bool getArgument( if (delimiter == nullptr) { badUsage(); } - assert(delimiter && "badUsage exits otherwise"); *delimiter = true; return false; } diff --git a/unoidl/source/unoidl-read.cxx b/unoidl/source/unoidl-read.cxx index 721fdabe9c8b..80d26a68c318 100644 --- a/unoidl/source/unoidl-read.cxx +++ b/unoidl/source/unoidl-read.cxx @@ -30,7 +30,7 @@ namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << " unoidl-read [--published] [--summary] [<extra registries>] <registry>" diff --git a/unoidl/source/unoidl-write.cxx b/unoidl/source/unoidl-write.cxx index e04fa16473a5..6505e5468e67 100644 --- a/unoidl/source/unoidl-write.cxx +++ b/unoidl/source/unoidl-write.cxx @@ -35,7 +35,7 @@ namespace { -void badUsage() { +[[noreturn]] void badUsage() { std::cerr << "Usage:" << std::endl << std::endl << " unoidl-write [<registries>] [@<entities file>] <unoidl file>" @@ -62,7 +62,6 @@ OUString getArgumentUri(sal_uInt32 argument, bool * entities) { if (entities == nullptr) { badUsage(); } - assert(entities && "badUsage exits otherwise"); *entities = true; } else if (entities != nullptr) { *entities = false;