mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-07-31 08:17:49 +00:00
Add ifdef guards around GCC diagnostic pragmas
This commit is contained in:
@@ -75,11 +75,13 @@ class CMockGenerator
|
||||
file << plugin_includes if (!plugin_includes.empty?)
|
||||
file << "\n"
|
||||
file << "/* Ignore the following warnings, since we are copying code */\n"
|
||||
file << "#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)\n"
|
||||
file << "#if defined(__GNUC__) && !defined(__ICC)\n"
|
||||
file << "#if !defined(__clang__)\n"
|
||||
file << "#pragma GCC diagnostic ignored \"-Wpragmas\"\n"
|
||||
file << "#endif\n"
|
||||
file << "#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n"
|
||||
file << "#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n"
|
||||
file << "#endif\n"
|
||||
file << "\n"
|
||||
end
|
||||
|
||||
|
||||
@@ -151,11 +151,13 @@ class SystemTestGenerator
|
||||
out.puts("#include \"#{include}\"")
|
||||
end
|
||||
out.puts('')
|
||||
out.puts("#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)")
|
||||
out.puts("#if defined(__GNUC__) && !defined(__ICC)")
|
||||
out.puts("#if !defined(__clang__)")
|
||||
out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"")
|
||||
out.puts("#endif")
|
||||
out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"')
|
||||
out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"')
|
||||
out.puts("#endif")
|
||||
out.puts('')
|
||||
yield(out)
|
||||
out.puts('')
|
||||
@@ -170,11 +172,13 @@ class SystemTestGenerator
|
||||
out.puts("#include \"#{include}\"")
|
||||
end
|
||||
out.puts('')
|
||||
out.puts("#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)")
|
||||
out.puts("#if defined(__GNUC__) && !defined(__ICC)")
|
||||
out.puts("#if !defined(__clang__)")
|
||||
out.puts("#pragma GCC diagnostic ignored \"-Wpragmas\"")
|
||||
out.puts("#endif")
|
||||
out.puts('#pragma GCC diagnostic ignored "-Wunknown-pragmas"')
|
||||
out.puts('#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"')
|
||||
out.puts("#endif")
|
||||
out.puts('')
|
||||
yield(out)
|
||||
out.puts('')
|
||||
|
||||
@@ -4,11 +4,13 @@
|
||||
[Released under MIT License. Please refer to license.txt for details]
|
||||
========================================== */
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
|
||||
#if defined(__GNUC__) && !defined(__ICC)
|
||||
#if !defined(__clang__)
|
||||
#pragma GCC diagnostic ignored "-Wpragmas"
|
||||
#endif
|
||||
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
|
||||
#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"
|
||||
#endif
|
||||
|
||||
struct _DUMMY_T { unsigned int a; float b; };
|
||||
|
||||
|
||||
@@ -95,11 +95,13 @@ class CMockGeneratorTest < Test::Unit::TestCase
|
||||
"#include \"PluginRequiredHeader.h\"\n",
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC)\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
|
||||
"#endif\n",
|
||||
"\n",
|
||||
]
|
||||
|
||||
@@ -139,11 +141,13 @@ class CMockGeneratorTest < Test::Unit::TestCase
|
||||
"#include \"PluginRequiredHeader.h\"\n",
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC)\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
|
||||
"#endif\n",
|
||||
"\n",
|
||||
]
|
||||
|
||||
@@ -169,11 +173,13 @@ class CMockGeneratorTest < Test::Unit::TestCase
|
||||
"#include \"#{orig_filename}\"\n",
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC)\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
|
||||
"#endif\n",
|
||||
"\n",
|
||||
]
|
||||
|
||||
@@ -200,11 +206,13 @@ class CMockGeneratorTest < Test::Unit::TestCase
|
||||
"#include \"PluginRequiredHeader.h\"\n",
|
||||
"\n",
|
||||
"/* Ignore the following warnings, since we are copying code */\n",
|
||||
"#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)\n",
|
||||
"#if defined(__GNUC__) && !defined(__ICC)\n",
|
||||
"#if !defined(__clang__)\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
|
||||
"#endif\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
|
||||
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
|
||||
"#endif\n",
|
||||
"\n",
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user