summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2025-01-20 17:38:50 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2025-01-20 17:38:50 +0100
commitfe0f5eba353b268336ebc775decf36b37ef805aa (patch)
treeb031e931d7144bd5a5ba038b591e953eb905062d
parent6c9cc1d83ef9147daf73c719453381e2b48088cc (diff)
Use trailing explicit return-type (instead of auto-deduction) for never-returning functions.
-rw-r--r--src/configure.cc3
-rw-r--r--src/libctor.cc3
2 files changed, 2 insertions, 4 deletions
diff --git a/src/configure.cc b/src/configure.cc
index 995e340..553e368 100644
--- a/src/configure.cc
+++ b/src/configure.cc
@@ -358,13 +358,12 @@ int regenerateCache(ctor::settings& settings,
opt.add("help", no_argument, 'h',
"Print this help text.",
- [&]() {
+ [&]() -> int {
std::cout << "Configure how to build with " << name << "\n";
std::cout << "Usage: " << name << " configure [options]\n\n";
std::cout << "Options:\n";
opt.help();
exit(0);
- return 0;
});
opt.process(static_cast<int>(vargs.size()), vargs.data());
diff --git a/src/libctor.cc b/src/libctor.cc
index b1fbaea..aaf17c9 100644
--- a/src/libctor.cc
+++ b/src/libctor.cc
@@ -159,7 +159,7 @@ int main(int argc, char* argv[])
opt.add("help", no_argument, 'h',
"Print this help text.",
- [&]() {
+ [&]() -> int {
std::cout << "Usage: " << args[0] << " [options] [target] ...\n";
std::cout <<
R"_( where target can be either:
@@ -174,7 +174,6 @@ Options:
)_";
opt.help();
exit(0);
- return 0;
});
opt.process(argc, argv);