diff --git a/Utilities/Config.cpp b/Utilities/Config.cpp index f962ff8c38..0ef1b882e3 100644 --- a/Utilities/Config.cpp +++ b/Utilities/Config.cpp @@ -35,12 +35,14 @@ namespace cfg bool _base::from_string(const std::string&, bool) { - fmt::throw_exception("from_string() purecall"); + cfg_log.fatal("cfg::_base::from_string() purecall"); + return false; } bool _base::from_list(std::vector&&) { - fmt::throw_exception("from_list() purecall"); + cfg_log.fatal("cfg::_base::from_list() purecall"); + return false; } // Emit YAML diff --git a/Utilities/File.cpp b/Utilities/File.cpp index 2fc9797a41..12083a3904 100644 --- a/Utilities/File.cpp +++ b/Utilities/File.cpp @@ -230,7 +230,7 @@ namespace fs { } - stat_t file_base::stat() + [[noreturn]] stat_t file_base::stat() { fmt::throw_exception("fs::file::stat() not supported."); } diff --git a/Utilities/File.h b/Utilities/File.h index 69d85fcfc6..ea8fe28582 100644 --- a/Utilities/File.h +++ b/Utilities/File.h @@ -81,7 +81,7 @@ namespace fs { virtual ~file_base(); - virtual stat_t stat(); + [[noreturn]] virtual stat_t stat(); virtual void sync(); virtual bool trunc(u64 length) = 0; virtual u64 read(void* buffer, u64 size) = 0; diff --git a/Utilities/JIT.cpp b/Utilities/JIT.cpp index c42d339b17..7c2c19c24d 100644 --- a/Utilities/JIT.cpp +++ b/Utilities/JIT.cpp @@ -289,6 +289,7 @@ asmjit::Runtime& asmjit::get_global_runtime() #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Wredundant-decls" #pragma GCC diagnostic ignored "-Weffc++" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" #endif #include "llvm/Support/TargetSelect.h" #include "llvm/Support/FormattedStream.h" diff --git a/Utilities/JIT.h b/Utilities/JIT.h index b346e8a550..82f92e206c 100644 --- a/Utilities/JIT.h +++ b/Utilities/JIT.h @@ -189,6 +189,7 @@ inline FT build_function_asm(F&& builder) #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Weffc++" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" #ifdef __clang__ #pragma clang diagnostic ignored "-Winconsistent-missing-override" #endif diff --git a/rpcs3/Emu/CPU/CPUTranslator.h b/rpcs3/Emu/CPU/CPUTranslator.h index 3fbefbf317..fe6c24c6b5 100644 --- a/rpcs3/Emu/CPU/CPUTranslator.h +++ b/rpcs3/Emu/CPU/CPUTranslator.h @@ -12,6 +12,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Weffc++" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" #endif #include "llvm/IR/LLVMContext.h" #include "llvm/IR/IRBuilder.h" diff --git a/rpcs3/Emu/Cell/Modules/cellFs.cpp b/rpcs3/Emu/Cell/Modules/cellFs.cpp index b72da97cf2..3885cd4ed8 100644 --- a/rpcs3/Emu/Cell/Modules/cellFs.cpp +++ b/rpcs3/Emu/Cell/Modules/cellFs.cpp @@ -945,7 +945,7 @@ s32 cellFsAioInit(vm::cptr mount_point) cellFs.warning("cellFsAioInit(mount_point=%s)", mount_point); // TODO: create AIO thread (if not exists) for specified mount point - fmt::throw_exception("cellFsAio disabled, use LLE."); + cellFs.fatal("cellFsAio disabled, use LLE."); return CELL_OK; } diff --git a/rpcs3/Emu/Cell/Modules/cellMic.cpp b/rpcs3/Emu/Cell/Modules/cellMic.cpp index d5a626db56..94dae18537 100644 --- a/rpcs3/Emu/Cell/Modules/cellMic.cpp +++ b/rpcs3/Emu/Cell/Modules/cellMic.cpp @@ -1009,7 +1009,8 @@ error_code cellMicGetStatus(s32 dev_num, vm::ptr status) error_code cellMicStopEx() { - fmt::throw_exception("Unexpected function"); + cellMic.fatal("cellMicStopEx: unexpected function"); + return CELL_OK; } error_code cellMicSysShareClose() diff --git a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp index f2cf5eb780..54b79228e8 100644 --- a/rpcs3/Emu/Cell/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellPngDec.cpp @@ -175,7 +175,7 @@ void pngDecEndCallback(png_structp png_ptr, png_infop info) } // Custom error handler for libpng -void pngDecError(png_structp png_ptr, png_const_charp error_message) +[[noreturn]] void pngDecError(png_structp png_ptr, png_const_charp error_message) { cellPngDec.error("%s", error_message); // we can't return here or libpng blows up diff --git a/rpcs3/Emu/Cell/Modules/cellSail.cpp b/rpcs3/Emu/Cell/Modules/cellSail.cpp index d1e4ad341d..60c857320b 100644 --- a/rpcs3/Emu/Cell/Modules/cellSail.cpp +++ b/rpcs3/Emu/Cell/Modules/cellSail.cpp @@ -489,22 +489,26 @@ error_code cellSailSourceNotifyMediaStateChanged() error_code cellSailSourceNotifyOpenCompleted() { - fmt::throw_exception("Unexpected function"); + cellSail.fatal("cellSailSourceNotifyOpenCompleted: unexpected function"); + return CELL_OK; } error_code cellSailSourceNotifyStartCompleted() { - fmt::throw_exception("Unexpected function"); + cellSail.fatal("cellSailSourceNotifyStartCompleted: unexpected function"); + return CELL_OK; } error_code cellSailSourceNotifyStopCompleted() { - fmt::throw_exception("Unexpected function"); + cellSail.fatal("cellSailSourceNotifyStopCompleted: unexpected function"); + return CELL_OK; } error_code cellSailSourceNotifyReadCompleted() { - fmt::throw_exception("Unexpected function"); + cellSail.fatal("cellSailSourceNotifyReadCompleted: unexpected function"); + return CELL_OK; } error_code cellSailSourceSetDiagHandler() @@ -515,7 +519,8 @@ error_code cellSailSourceSetDiagHandler() error_code cellSailSourceNotifyCloseCompleted() { - fmt::throw_exception("Unexpected function"); + cellSail.fatal("cellSailSourceNotifyCloseCompleted: unexpected function"); + return CELL_OK; } error_code cellSailMp4MovieGetBrand() diff --git a/rpcs3/Emu/Cell/Modules/libmixer.cpp b/rpcs3/Emu/Cell/Modules/libmixer.cpp index c6d8778ae9..e9aa8d502a 100644 --- a/rpcs3/Emu/Cell/Modules/libmixer.cpp +++ b/rpcs3/Emu/Cell/Modules/libmixer.cpp @@ -669,20 +669,20 @@ void cellSurMixerBeep(u32 arg) f32 cellSurMixerUtilGetLevelFromDB(f32 dB) { - libmixer.todo("cellSurMixerUtilGetLevelFromDB(dB=%f)", dB); - fmt::throw_exception("TODO"); + libmixer.fatal("cellSurMixerUtilGetLevelFromDB(dB=%f)", dB); + return 0; } f32 cellSurMixerUtilGetLevelFromDBIndex(s32 index) { - libmixer.todo("cellSurMixerUtilGetLevelFromDBIndex(index=%d)", index); - fmt::throw_exception("TODO"); + libmixer.fatal("cellSurMixerUtilGetLevelFromDBIndex(index=%d)", index); + return 0; } f32 cellSurMixerUtilNoteToRatio(u8 refNote, u8 note) { - libmixer.todo("cellSurMixerUtilNoteToRatio(refNote=%d, note=%d)", refNote, note); - fmt::throw_exception("TODO"); + libmixer.fatal("cellSurMixerUtilNoteToRatio(refNote=%d, note=%d)", refNote, note); + return 0; } DECLARE(ppu_module_manager::libmixer)("libmixer", []() diff --git a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp index b1522e1d22..d1d69a764a 100644 --- a/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp +++ b/rpcs3/Emu/Cell/Modules/sysPrxForUser.cpp @@ -140,7 +140,8 @@ error_code cellSysconfPs1emu_EFDDAF6C() error_code sys_lv2coredump_D725F320() { - fmt::throw_exception("Unknown, unimplemented."); + sysPrxForUser.fatal("sys_lv2coredump_D725F320"); + return CELL_OK; } error_code sys_get_bd_media_id() diff --git a/rpcs3/Emu/Cell/PPUInterpreter.cpp b/rpcs3/Emu/Cell/PPUInterpreter.cpp index d7d44cc000..5bb6abf9b5 100644 --- a/rpcs3/Emu/Cell/PPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/PPUInterpreter.cpp @@ -3896,7 +3896,8 @@ bool ppu_interpreter::EQV(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::ECIWX(ppu_thread&, ppu_opcode_t) { - fmt::throw_exception("ECIWX"); + ppu_log.fatal("ECIWX"); + return false; } bool ppu_interpreter::LHZUX(ppu_thread& ppu, ppu_opcode_t op) @@ -4010,7 +4011,8 @@ bool ppu_interpreter::ORC(ppu_thread& ppu, ppu_opcode_t op) bool ppu_interpreter::ECOWX(ppu_thread&, ppu_opcode_t) { - fmt::throw_exception("ECOWX"); + ppu_log.fatal("ECOWX"); + return false; } bool ppu_interpreter::STHUX(ppu_thread& ppu, ppu_opcode_t op) diff --git a/rpcs3/Emu/Cell/PPUThread.cpp b/rpcs3/Emu/Cell/PPUThread.cpp index 582c38274d..c71a85d390 100644 --- a/rpcs3/Emu/Cell/PPUThread.cpp +++ b/rpcs3/Emu/Cell/PPUThread.cpp @@ -34,6 +34,7 @@ #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Weffc++" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" #endif #include "llvm/Support/FormattedStream.h" #include "llvm/Support/MemoryBuffer.h" diff --git a/rpcs3/Emu/Cell/SPUInterpreter.cpp b/rpcs3/Emu/Cell/SPUInterpreter.cpp index 8c13d4a2ea..2660f997ce 100644 --- a/rpcs3/Emu/Cell/SPUInterpreter.cpp +++ b/rpcs3/Emu/Cell/SPUInterpreter.cpp @@ -95,7 +95,8 @@ namespace asmjit bool spu_interpreter::UNK(spu_thread&, spu_opcode_t op) { - fmt::throw_exception("Unknown/Illegal instruction (0x%08x)", op.opcode); + spu_log.fatal("Unknown/Illegal instruction (0x%08x)", op.opcode); + return false; } @@ -992,8 +993,8 @@ bool spu_interpreter_fast::FCGT(spu_thread& spu, spu_opcode_t op) bool spu_interpreter::DFCGT(spu_thread&, spu_opcode_t) { - fmt::throw_exception("Unexpected instruction"); - return true; + spu_log.fatal("DFCGT"); + return false; } bool spu_interpreter_fast::FA(spu_thread& spu, spu_opcode_t op) @@ -1079,8 +1080,8 @@ bool spu_interpreter_fast::FCMGT(spu_thread& spu, spu_opcode_t op) bool spu_interpreter::DFCMGT(spu_thread&, spu_opcode_t) { - fmt::throw_exception("Unexpected Instruction"); - return true; + spu_log.fatal("DFCMGT"); + return false; } bool spu_interpreter_fast::DFA(spu_thread& spu, spu_opcode_t op) @@ -1227,8 +1228,8 @@ bool spu_interpreter_fast::FSCRWR(spu_thread&, spu_opcode_t) bool spu_interpreter::DFTSV(spu_thread&, spu_opcode_t) { - fmt::throw_exception("Unexpected instruction"); - return true; + spu_log.fatal("DFTSV"); + return false; } bool spu_interpreter_fast::FCEQ(spu_thread& spu, spu_opcode_t op) @@ -1239,8 +1240,8 @@ bool spu_interpreter_fast::FCEQ(spu_thread& spu, spu_opcode_t op) bool spu_interpreter::DFCEQ(spu_thread&, spu_opcode_t) { - fmt::throw_exception("Unexpected instruction"); - return true; + spu_log.fatal("DFCEQ"); + return false; } bool spu_interpreter::MPY(spu_thread& spu, spu_opcode_t op) @@ -1283,8 +1284,8 @@ bool spu_interpreter_fast::FCMEQ(spu_thread& spu, spu_opcode_t op) bool spu_interpreter::DFCMEQ(spu_thread&, spu_opcode_t) { - fmt::throw_exception("Unexpected instruction"); - return true; + spu_log.fatal("DFCMEQ"); + return false; } bool spu_interpreter::MPYU(spu_thread& spu, spu_opcode_t op) diff --git a/rpcs3/Emu/Cell/SPURecompiler.cpp b/rpcs3/Emu/Cell/SPURecompiler.cpp index 2950dbdc25..27807f6f22 100644 --- a/rpcs3/Emu/Cell/SPURecompiler.cpp +++ b/rpcs3/Emu/Cell/SPURecompiler.cpp @@ -3220,6 +3220,7 @@ void spu_recompiler_base::dump(const spu_program& result, std::string& out) #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wstrict-aliasing" #pragma GCC diagnostic ignored "-Weffc++" +#pragma GCC diagnostic ignored "-Wmissing-noreturn" #endif #include "llvm/ADT/Triple.h" #include "llvm/IR/LegacyPassManager.h" @@ -5311,7 +5312,7 @@ public: call(name, &exec_fall, m_thread, m_ir->getInt32(op.opcode)); } - static void exec_unk(spu_thread*, u32 op) + [[noreturn]] static void exec_unk(spu_thread*, u32 op) { fmt::throw_exception("Unknown/Illegal instruction (0x%08x)", op); } diff --git a/rpcs3/Emu/Cell/SPUThread.cpp b/rpcs3/Emu/Cell/SPUThread.cpp index dc8eb49b04..ea28fa0608 100644 --- a/rpcs3/Emu/Cell/SPUThread.cpp +++ b/rpcs3/Emu/Cell/SPUThread.cpp @@ -4675,7 +4675,8 @@ void spu_thread::halt() spu_runtime::g_escape(this); } - fmt::throw_exception("Halt"); + spu_log.fatal("Halt"); + spu_runtime::g_escape(this); } void spu_thread::fast_call(u32 ls_addr) diff --git a/rpcs3/Emu/Memory/vm.cpp b/rpcs3/Emu/Memory/vm.cpp index 8db94d661f..24c6fba5d0 100644 --- a/rpcs3/Emu/Memory/vm.cpp +++ b/rpcs3/Emu/Memory/vm.cpp @@ -631,7 +631,7 @@ namespace vm }); } - void reservation_escape_internal() + [[noreturn]] void reservation_escape_internal() { const auto _cpu = get_current_cpu_thread(); diff --git a/rpcs3/Emu/Memory/vm_reservation.h b/rpcs3/Emu/Memory/vm_reservation.h index dcf4f606ff..e27d083618 100644 --- a/rpcs3/Emu/Memory/vm_reservation.h +++ b/rpcs3/Emu/Memory/vm_reservation.h @@ -324,7 +324,7 @@ namespace vm } // For internal usage - void reservation_escape_internal(); + [[noreturn]] void reservation_escape_internal(); // Read memory value in pseudo-atomic manner template diff --git a/rpcs3/cmake_modules/ConfigureCompiler.cmake b/rpcs3/cmake_modules/ConfigureCompiler.cmake index 4485d96ee3..d65e3f4c5d 100644 --- a/rpcs3/cmake_modules/ConfigureCompiler.cmake +++ b/rpcs3/cmake_modules/ConfigureCompiler.cmake @@ -32,6 +32,7 @@ else() add_compile_options(-Werror=reorder) add_compile_options(-Werror=return-type) add_compile_options(-Werror=overloaded-virtual) + add_compile_options(-Werror=missing-noreturn) add_compile_options(-Wunused-parameter) add_compile_options(-Wignored-qualifiers) add_compile_options(-Wredundant-move)