# define USE_WCHAR_T
#endif
+#if defined(__GNUC__) && !defined(__clang__)
+/* This macro can be used to stipulate that a given GCC warning is not
+ * relevant in a given block.
+ *
+ * The -Wpragmas bit takes care of the case where -W<warn> is not implemented
+ *
+ * The idea for PRAGMA_IGNORE has been stolen from
+ * https://stackoverflow.com/questions/45762357/how-to-concatenate-strings-in-the-arguments-of-pragma#comment124444258_45783809
+ * The difficulty is to put the <warn> value inside nested quotes; it is done
+ * using nested macros.
+ */
+# define PRAGMA_IGNORE(x) PRAGMA_IGNORE_1(-W##x)
+# define PRAGMA_IGNORE_1(x) PRAGMA_IGNORE_2(#x)
+# define PRAGMA_IGNORE_2(x) PRAGMA_IGNORE_3(GCC diagnostic ignored x)
+# define PRAGMA_IGNORE_3(x) _Pragma(#x)
+# define LYX_BEGIN_MUTE_GCC_WARNING(warn) \
+ _Pragma("GCC diagnostic push") \
+ _Pragma("GCC diagnostic ignored \"-Wpragmas\"") \
+ PRAGMA_IGNORE(warn)
+# define LYX_END_MUTE_GCC_WARNING \
+ _Pragma("GCC diagnostic pop")
+#else
+# define LYX_BEGIN_MUTE_GCC_WARNING(warn)
+# define LYX_END_MUTE_GCC_WARNING
+#endif
+
+
#endif
])
extern Movers & theMovers();
+LYX_BEGIN_MUTE_GCC_WARNING(dangling-reference)
/// @c returns the Mover registered for format @c fmt.
extern Mover const & getMover(std::string const & fmt);
+LYX_END_MUTE_GCC_WARNING
/** Register a specialised @c command to be used to copy a file
* of format @c fmt.
*/
std::unique_ptr<Impl> d;
};
+LYX_BEGIN_MUTE_GCC_WARNING(dangling-reference)
WordList & theWordList(std::string const & lang);
+LYX_END_MUTE_GCC_WARNING
} // namespace lyx
class FontInfo;
/// Implementation is in Application.cpp
+
+LYX_BEGIN_MUTE_GCC_WARNING(dangling-reference)
frontend::FontMetrics const & theFontMetrics(Font const & f);
frontend::FontMetrics const & theFontMetrics(FontInfo const & fi);
+LYX_END_MUTE_GCC_WARNING
+
} // namespace lyx