Added gcc version specific fix for pragma ignores

This commit is contained in:
Greg Williams
2014-07-25 16:07:55 -04:00
parent 7d72a32271
commit e4098dba9a
4 changed files with 24 additions and 0 deletions
+3
View File
@@ -75,6 +75,9 @@ 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 << "#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 << "\n"
+6
View File
@@ -151,6 +151,9 @@ class SystemTestGenerator
out.puts("#include \"#{include}\"")
end
out.puts('')
out.puts("#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)")
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('')
@@ -167,6 +170,9 @@ class SystemTestGenerator
out.puts("#include \"#{include}\"")
end
out.puts('')
out.puts("#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)")
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('')
+3
View File
@@ -4,6 +4,9 @@
[Released under MIT License. Please refer to license.txt for details]
========================================== */
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)
#pragma GCC diagnostic ignored "-Wpragmas"
#endif
#pragma GCC diagnostic ignored "-Wunknown-pragmas"
#pragma GCC diagnostic ignored "-Wduplicate-decl-specifier"
+12
View File
@@ -95,6 +95,9 @@ 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",
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
"#endif\n",
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
"\n",
@@ -136,6 +139,9 @@ 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",
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
"#endif\n",
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
"\n",
@@ -163,6 +169,9 @@ 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",
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
"#endif\n",
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
"\n",
@@ -191,6 +200,9 @@ 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",
"#pragma GCC diagnostic ignored \"-Wpragmas\"\n",
"#endif\n",
"#pragma GCC diagnostic ignored \"-Wunknown-pragmas\"\n",
"#pragma GCC diagnostic ignored \"-Wduplicate-decl-specifier\"\n",
"\n",