瀏覽代碼

Fix M100 compile warning

Scott Lahteine 5 年之前
父節點
當前提交
19873f04d4
共有 1 個文件被更改,包括 8 次插入3 次删除
  1. 8
    3
      Marlin/src/gcode/calibrate/M100.cpp

+ 8
- 3
Marlin/src/gcode/calibrate/M100.cpp 查看文件

116
 // Utility functions
116
 // Utility functions
117
 //
117
 //
118
 
118
 
119
-// Location of a variable on its stack frame. Returns a value above
120
-// the stack (once the function returns to the caller).
121
-char* top_of_stack() {
119
+#pragma GCC diagnostic push
120
+#pragma GCC diagnostic ignored "-Wreturn-local-addr"
121
+
122
+// Location of a variable in its stack frame.
123
+// The returned address will be above the stack (after it returns).
124
+char *top_of_stack() {
122
   char x;
125
   char x;
123
   return &x + 1; // x is pulled on return;
126
   return &x + 1; // x is pulled on return;
124
 }
127
 }
125
 
128
 
129
+#pragma GCC diagnostic pop
130
+
126
 // Count the number of test bytes at the specified location.
131
 // Count the number of test bytes at the specified location.
127
 inline int32_t count_test_bytes(const char * const start_free_memory) {
132
 inline int32_t count_test_bytes(const char * const start_free_memory) {
128
   for (uint32_t i = 0; i < 32000; i++)
133
   for (uint32_t i = 0; i < 32000; i++)

Loading…
取消
儲存