Skip to content

Commit 8224a85

Browse files
bmouritEvilGremlin
authored andcommitted
🔨 Fix GCC14 / C++23 volatile warnings (MarlinFirmware#27768)
1 parent 65559f7 commit 8224a85

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Marlin/src/module/planner.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1582,7 +1582,9 @@ void Planner::quick_stop() {
15821582
const bool was_enabled = stepper.suspend();
15831583

15841584
// Drop all queue entries
1585-
block_buffer_nonbusy = block_buffer_head = block_buffer_tail;
1585+
const uint8_t tail_value = block_buffer_tail; // Read tail value once
1586+
block_buffer_head = tail_value;
1587+
block_buffer_nonbusy = tail_value;
15861588

15871589
// Restart the block delay for the first movement - As the queue was
15881590
// forced to empty, there's no risk the ISR will touch this.

Marlin/src/module/planner.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,11 @@ class Planner {
816816
FORCE_INLINE static uint8_t nonbusy_movesplanned() { return block_dec_mod(block_buffer_head, block_buffer_nonbusy); }
817817

818818
// Remove all blocks from the buffer
819-
FORCE_INLINE static void clear_block_buffer() { block_buffer_nonbusy = block_buffer_head = block_buffer_tail = 0; }
819+
FORCE_INLINE static void clear_block_buffer() {
820+
block_buffer_tail = 0;
821+
block_buffer_head = 0;
822+
block_buffer_nonbusy = 0;
823+
}
820824

821825
// Check if movement queue is full
822826
FORCE_INLINE static bool is_full() { return block_buffer_tail == next_block_index(block_buffer_head); }

ini/gd32.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ build_flags = -std=gnu++23
2121
-DADC_RESOLUTION=12
2222
-DCORE_DEBUG
2323
-Wno-deprecated-declarations
24-
-Wno-volatile
2524
extra_scripts = ${common.extra_scripts}
2625

2726
#

0 commit comments

Comments
 (0)