From 218459f454b263f02518ed22f8375cc040c9116d Mon Sep 17 00:00:00 2001 From: Martin Konrad Date: Tue, 22 Oct 2019 13:48:33 -0400 Subject: [PATCH] Remove epicsThrows() macro Exception specifications are deprecated: http://isocpp.github.io/ CppCoreGuidelines/CppCoreGuidelines.html#e30-dont-use-exception- specifications . They will be removed from the C++ standard with C++20. Modern compilers are warning about them since years. Thus it's unlikely that anyone is still using the epicsThrows() macro. Even if that's the case the fix is trivial: Simply remove the macro. --- .../libcom/src/osi/compiler/clang/compilerSpecific.h | 2 -- .../libcom/src/osi/compiler/gcc/compilerSpecific.h | 2 -- modules/libcom/src/osi/compilerDependencies.h | 12 ------------ 3 files changed, 16 deletions(-) diff --git a/modules/libcom/src/osi/compiler/clang/compilerSpecific.h b/modules/libcom/src/osi/compiler/clang/compilerSpecific.h index 2053227e7..0498f6e27 100644 --- a/modules/libcom/src/osi/compiler/clang/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/clang/compilerSpecific.h @@ -33,10 +33,8 @@ /* * CXX_PLACEMENT_DELETE - defined if compiler supports placement delete - * CXX_THROW_SPECIFICATION - defined if compiler supports throw specification */ #define CXX_PLACEMENT_DELETE -#define CXX_THROW_SPECIFICATION #endif /* __cplusplus */ diff --git a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h index e140d8b05..3342308a9 100644 --- a/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h +++ b/modules/libcom/src/osi/compiler/gcc/compilerSpecific.h @@ -40,9 +40,7 @@ /* * CXX_PLACEMENT_DELETE - defined if compiler supports placement delete - * CXX_THROW_SPECIFICATION - defined if compiler supports throw specification */ -#define CXX_THROW_SPECIFICATION #define CXX_PLACEMENT_DELETE #endif /* __cplusplus */ diff --git a/modules/libcom/src/osi/compilerDependencies.h b/modules/libcom/src/osi/compilerDependencies.h index 3bd835c91..0b333d74e 100644 --- a/modules/libcom/src/osi/compilerDependencies.h +++ b/modules/libcom/src/osi/compilerDependencies.h @@ -20,18 +20,6 @@ #ifdef __cplusplus -/* - * usage: void func () epicsThrows (( std::bad_alloc, std::logic_error )) - * - * Note: now a widely accepted concensus (ref Meyers and C++ faq) is that - * one should avoid using throw specifications in C++ code - */ -#if defined ( CXX_THROW_SPECIFICATION ) -# define epicsThrows(X) throw X -#else -# define epicsThrows(X) -#endif - /* * usage: epicsPlacementDeleteOperator (( void *, myMemoryManager & )) */