Skip to content

Commit

Permalink
MMDevice/MMCore: Suppress GCC warnings for throw()
Browse files Browse the repository at this point in the history
There is no way to suppress just for exception specifications, but limit
the suppression to within the headers.
  • Loading branch information
marktsuchida committed Dec 14, 2023
1 parent 03df42e commit 982a5cd
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
9 changes: 9 additions & 0 deletions MMCore/CircularBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
#pragma warning(disable: 4290) // 'C++ exception specification ignored'
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
// 'dynamic exception specifications are deprecated in C++11 [-Wdeprecated]'
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif

class ThreadPool;
class TaskSet_CopyMemory;
Expand Down Expand Up @@ -101,6 +106,10 @@ class CircularBuffer
std::shared_ptr<TaskSet_CopyMemory> tasksMemCopy_;
};

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif
10 changes: 10 additions & 0 deletions MMCore/Configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
#pragma warning(disable: 4290) // 'C++ exception specification ignored'
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
// 'dynamic exception specifications are deprecated in C++11 [-Wdeprecated]'
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif

#include <string>
#include <vector>
#include <map>
Expand Down Expand Up @@ -119,6 +125,10 @@ class Configuration
std::map<std::string, int> index_;
};

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif
10 changes: 10 additions & 0 deletions MMCore/MMCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@
#pragma warning(disable: 4290) // 'C++ exception specification ignored'
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
// 'dynamic exception specifications are deprecated in C++11 [-Wdeprecated]'
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif

#include "../MMDevice/DeviceThreads.h"
#include "../MMDevice/MMDevice.h"
#include "../MMDevice/MMDeviceConstants.h"
Expand Down Expand Up @@ -693,6 +699,10 @@ class CMMCore
void loadSystemConfigurationImpl(const char* fileName) throw (CMMError);
};

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif
12 changes: 11 additions & 1 deletion MMDevice/ImageMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
#pragma warning(disable: 4290) // 'C++ exception specification ignored'
#endif

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic push
// 'dynamic exception specifications are deprecated in C++11 [-Wdeprecated]'
#pragma GCC diagnostic ignored "-Wdeprecated"
#endif

#include "MMDeviceConstants.h"

#include <string>
Expand Down Expand Up @@ -319,7 +325,7 @@ class Metadata
else
return false;
}

MetadataSingleTag GetSingleTag(const char* key) const throw (MetadataKeyError)
{
MetadataTag* tag = FindTag(key);
Expand Down Expand Up @@ -494,6 +500,10 @@ class Metadata
typedef std::map<std::string, MetadataTag*>::const_iterator TagConstIter;
};

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif

0 comments on commit 982a5cd

Please sign in to comment.