diff options
author | 2013-02-26 20:22:30 -0800 | |
---|---|---|
committer | 2013-03-02 09:24:47 -0800 | |
commit | 16b3eee5ba0a51edbcb08b06240fa3a8ba494031 (patch) | |
tree | 84ca5d0ae74956a2cb265df700c6d7cbd413d835 | |
parent | b784a32a074800cf0b68bf4ab334909e1a04a0e4 (diff) | |
download | paludis-16b3eee5ba0a51edbcb08b06240fa3a8ba494031.tar.gz paludis-16b3eee5ba0a51edbcb08b06240fa3a8ba494031.tar.xz |
cleanup not-reached warnings
Use the preprocessor more aggresively to avoid a not-reached warning, and mark
functions as non-return if necessary.
-rw-r--r-- | paludis/tar_merger.cc | 7 | ||||
-rw-r--r-- | src/clients/cave/search_extras_handle.cc | 4 | ||||
-rw-r--r-- | src/clients/cave/search_extras_handle.hh | 6 |
3 files changed, 12 insertions, 5 deletions
diff --git a/paludis/tar_merger.cc b/paludis/tar_merger.cc index d48775395..bb508fcbe 100644 --- a/paludis/tar_merger.cc +++ b/paludis/tar_merger.cc @@ -57,11 +57,13 @@ namespace CleanupPtr cleanup; TarMergerHandle() +#ifndef ENABLE_PBINS + PALUDIS_ATTRIBUTE((noreturn)) +#endif { #ifndef ENABLE_PBINS throw NotAvailableError("Paludis was built without support for pbins"); -#endif - +#else handle = ::dlopen(("libpaludistarextras_" + stringify(PALUDIS_PC_SLOT) + ".so").c_str(), RTLD_NOW | RTLD_GLOBAL); if (! handle) throw MergerError("Unable to open libpaludistarextras due to error '" + stringify(::dlerror()) + "' from dlopen"); @@ -81,6 +83,7 @@ namespace cleanup = STUPID_CAST(CleanupPtr, ::dlsym(handle, "paludis_tar_extras_cleanup")); if (! cleanup) throw MergerError("Unable to cleanup from libpaludistarextras due to error '" + stringify(::dlerror()) + "' from dlsym"); +#endif } ~TarMergerHandle() diff --git a/src/clients/cave/search_extras_handle.cc b/src/clients/cave/search_extras_handle.cc index 95ce8c772..d3e921561 100644 --- a/src/clients/cave/search_extras_handle.cc +++ b/src/clients/cave/search_extras_handle.cc @@ -49,8 +49,7 @@ SearchExtrasHandle::SearchExtrasHandle() : { #ifndef ENABLE_SEARCH_INDEX throw NotAvailableError("cave was built without support for search indexes"); -#endif - +#else handle = ::dlopen(("libcavesearchextras_" + stringify(PALUDIS_PC_SLOT) + ".so").c_str(), RTLD_NOW | RTLD_GLOBAL); if (! handle) throw args::DoHelp("Search index creation not available because dlopen said " + stringify(::dlerror())); @@ -82,6 +81,7 @@ SearchExtrasHandle::SearchExtrasHandle() : find_candidates_function = STUPID_CAST(FindCandidatesFunction, ::dlsym(handle, "cave_search_extras_find_candidates")); if (! find_candidates_function) throw args::DoHelp("Search index not available because dlsym said " + stringify(::dlerror())); +#endif } SearchExtrasHandle::~SearchExtrasHandle() diff --git a/src/clients/cave/search_extras_handle.hh b/src/clients/cave/search_extras_handle.hh index dd85bd272..dfa766d0a 100644 --- a/src/clients/cave/search_extras_handle.hh +++ b/src/clients/cave/search_extras_handle.hh @@ -59,7 +59,11 @@ namespace paludis FindCandidatesFunction find_candidates_function; - SearchExtrasHandle(); + SearchExtrasHandle() +#ifndef ENABLE_SEARCH_INDEX + PALUDIS_ATTRIBUTE((noreturn)) +#endif + ; ~SearchExtrasHandle(); }; } |