Browse Source

🩹 Fix pragma ignored for older GCC (#22978)

Mike La Spina 3 years ago
parent
commit
52edc543bd
No account linked to committer's email address
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      Marlin/src/gcode/gcode.cpp

+ 5
- 4
Marlin/src/gcode/gcode.cpp View File

1095
   process_parsed_command();
1095
   process_parsed_command();
1096
 }
1096
 }
1097
 
1097
 
1098
+#pragma GCC diagnostic push
1099
+#if GCC_VERSION >= 80000
1100
+  #pragma GCC diagnostic ignored "-Wstringop-truncation"
1101
+#endif
1102
+
1098
 /**
1103
 /**
1099
  * Run a series of commands, bypassing the command queue to allow
1104
  * Run a series of commands, bypassing the command queue to allow
1100
  * G-code "macros" to be called from within other G-code handlers.
1105
  * G-code "macros" to be called from within other G-code handlers.
1101
  */
1106
  */
1102
-
1103
-#pragma GCC diagnostic push
1104
-#pragma GCC diagnostic ignored "-Wstringop-truncation"
1105
-
1106
 void GcodeSuite::process_subcommands_now(FSTR_P fgcode) {
1107
 void GcodeSuite::process_subcommands_now(FSTR_P fgcode) {
1107
   PGM_P pgcode = FTOP(fgcode);
1108
   PGM_P pgcode = FTOP(fgcode);
1108
   char * const saved_cmd = parser.command_ptr;        // Save the parser state
1109
   char * const saved_cmd = parser.command_ptr;        // Save the parser state

Loading…
Cancel
Save