Browse Source

Ignore warnings of glaring uselessness on clang-cl.

I hope those don't fire on regular Windows clang as well, this seems to
be specific to the way how MSVC-compatible template instantiation works.
pull/680/head
Vladimír Vondruš 8 months ago
parent
commit
9ee7e899aa
  1. 10
      src/Magnum/ShaderTools/AbstractConverter.h
  2. 10
      src/Magnum/Text/AbstractFont.h
  3. 10
      src/Magnum/Trade/AbstractImporter.h

10
src/Magnum/ShaderTools/AbstractConverter.h

@ -1184,12 +1184,22 @@ class MAGNUM_SHADERTOOLS_EXPORT AbstractConverter: public PluginManager::Abstrac
Containers::Optional<Containers::ArrayView<const char>>(*_inputFileCallback)(const std::string&, InputFileCallbackPolicy, void*){};
void* _inputFileCallbackUserData{};
/* clang-cl on Windows complains about this field being unused if the
templated setFileCallback() isn't called. Well, sure, it isn't used
in that particular case, but what am I supposed to do?! */
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-private-field"
#endif
/* Used by the templated version only */
struct FileCallbackTemplate {
void(*callback)();
const void* userData;
/* GCC 4.8 complains loudly about missing initializers otherwise */
} _inputFileCallbackTemplate{nullptr, nullptr};
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic pop
#endif
};
/**

10
src/Magnum/Text/AbstractFont.h

@ -805,12 +805,22 @@ class MAGNUM_TEXT_EXPORT AbstractFont: public PluginManager::AbstractPlugin {
Containers::Optional<Containers::ArrayView<const char>>(*_fileCallback)(const std::string&, InputFileCallbackPolicy, void*){};
void* _fileCallbackUserData{};
/* clang-cl on Windows complains about this field being unused if the
templated setFileCallback() isn't called. Well, sure, it isn't used
in that particular case, but what am I supposed to do?! */
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-private-field"
#endif
/* Used by the templated version only */
struct FileCallbackTemplate {
void(*callback)();
const void* userData;
/* GCC 4.8 complains loudly about missing initializers otherwise */
} _fileCallbackTemplate{nullptr, nullptr};
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic pop
#endif
Float _size{}, _ascent{}, _descent{}, _lineHeight{};
UnsignedInt _glyphCount{};

10
src/Magnum/Trade/AbstractImporter.h

@ -2614,12 +2614,22 @@ class MAGNUM_TRADE_EXPORT AbstractImporter: public PluginManager::AbstractManagi
Containers::Optional<Containers::ArrayView<const char>>(*_fileCallback)(const std::string&, InputFileCallbackPolicy, void*){};
void* _fileCallbackUserData{};
/* clang-cl on Windows complains about this field being unused if the
templated setFileCallback() isn't called. Well, sure, it isn't used
in that particular case, but what am I supposed to do?! */
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-private-field"
#endif
/* Used by the templated version only */
struct FileCallbackTemplate {
void(*callback)();
const void* userData;
/* GCC 4.8 complains loudly about missing initializers otherwise */
} _fileCallbackTemplate{nullptr, nullptr};
#ifdef CORRADE_TARGET_CLANG_CL
#pragma GCC diagnostic pop
#endif
#ifdef MAGNUM_BUILD_DEPRECATED
struct CachedScenes;

Loading…
Cancel
Save