From bd82b8bc7ee506d89a99a408fccdad5853ab39b6 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Tue, 28 Apr 2020 08:30:52 -0500 Subject: [PATCH] Suppress compile warnings --- Marlin/src/MarlinCore.cpp | 5 +++++ Marlin/src/gcode/queue.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/Marlin/src/MarlinCore.cpp b/Marlin/src/MarlinCore.cpp index 28a1b0c98f..26a7fb0684 100644 --- a/Marlin/src/MarlinCore.cpp +++ b/Marlin/src/MarlinCore.cpp @@ -285,6 +285,9 @@ void setup_powerhold() { #include "pins/sensitive_pins.h" +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wnarrowing" + bool pin_is_protected(const pin_t pin) { static const pin_t sensitive_pins[] PROGMEM = SENSITIVE_PINS; LOOP_L_N(i, COUNT(sensitive_pins)) { @@ -295,6 +298,8 @@ bool pin_is_protected(const pin_t pin) { return false; } +#pragma GCC diagnostic pop + void protected_pin_err() { SERIAL_ERROR_MSG(STR_ERR_PROTECTED_PIN); } diff --git a/Marlin/src/gcode/queue.cpp b/Marlin/src/gcode/queue.cpp index 7c4dc08486..4d7d107ebd 100644 --- a/Marlin/src/gcode/queue.cpp +++ b/Marlin/src/gcode/queue.cpp @@ -216,8 +216,14 @@ bool GCodeQueue::process_injected_command() { gcode.process_parsed_command(); } + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wrestrict" + // Copy the next command into place strcpy(injected_commands, &injected_commands[i + (c != '\0')]); + + #pragma GCC diagnostic pop + return true; }