Skip to content

Commit

Permalink
🎨 Pragma GCC cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 25, 2021
1 parent 18b38fb commit aa198e4
Show file tree
Hide file tree
Showing 13 changed files with 26 additions and 52 deletions.
6 changes: 2 additions & 4 deletions Marlin/src/HAL/AVR/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,14 @@ inline uint8_t HAL_get_reset_source() { return MCUSR; }

void HAL_reboot();

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

extern "C" int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

// ADC
#ifdef DIDR2
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/DUE/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,14 @@ void HAL_init();
//
void _delay_ms(const int delay);

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

#ifdef __cplusplus
extern "C" {
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/ESP32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,14 @@ void HAL_reboot();

void _delay_ms(int delay);

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

void analogWrite(pin_t pin, int value);

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/LINUX/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ extern MSerialT usb_serial;
inline void HAL_init() {}

// Utility functions
#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

// ADC
#define HAL_ADC_VREF 5.0
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/LPC1768/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,14 @@ extern DefaultSerial1 USBSerial;
//
// Utility functions
//
#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

//
// ADC API
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/SAMD51/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,14 @@ void HAL_idletask();
//
FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

#ifdef __cplusplus
extern "C" {
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/TEENSY31_32/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,14 @@ void HAL_reboot();

FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

extern "C" int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

// ADC

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/TEENSY35_36/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,14 @@ void HAL_reboot();

FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

extern "C" int freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

// ADC

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/HAL/TEENSY40_41/HAL.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,14 @@ void HAL_reboot();

FORCE_INLINE void _delay_ms(const int delay_ms) { delay(delay_ms); }

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

extern "C" uint32_t freeMemory();

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

// ADC

Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/lcd/dogm/status_screen_DOGM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -862,17 +862,15 @@ void MarlinUI::draw_status_screen() {
mix_label = PSTR("Mx");
}

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
#endif

sprintf_P(mixer_messages, PSTR(S_FMT " %d;%d%% "), mix_label, int(mixer.mix[0]), int(mixer.mix[1]));
lcd_put_u8str(X_LABEL_POS, XYZ_BASELINE, mixer_messages);

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

#else

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@

#define ROUND(val) uint16_t((val)+0.5)

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wno-format"
#endif

Expand Down Expand Up @@ -105,8 +105,6 @@ void format_position(char *str, float x, float y, float z) {
sprintf_P(str, PSTR("%s; %s; %s " S_FMT), num1, num2, num3, GET_TEXT(MSG_UNITS_MM));
}

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

#endif // TOUCH_UI_FTDI_EVE
6 changes: 2 additions & 4 deletions Marlin/src/libs/duration_t.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ struct duration_t {
return this->value;
}

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-overflow"
#endif

Expand Down Expand Up @@ -170,7 +170,5 @@ struct duration_t {
}
}

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop
};
6 changes: 2 additions & 4 deletions Marlin/src/module/endstops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ void Endstops::event_handler() {
}
}

#pragma GCC diagnostic push
#if GCC_VERSION <= 50000
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-function"
#endif

Expand All @@ -489,9 +489,7 @@ static void print_es_state(const bool is_hit, FSTR_P const flabel=nullptr) {
SERIAL_ECHOLNF(is_hit ? F(STR_ENDSTOP_HIT) : F(STR_ENDSTOP_OPEN));
}

#if GCC_VERSION <= 50000
#pragma GCC diagnostic pop
#endif
#pragma GCC diagnostic pop

void _O2 Endstops::report_states() {
TERN_(BLTOUCH, bltouch._set_SW_mode());
Expand Down

0 comments on commit aa198e4

Please sign in to comment.