LONGER3D / Marlin1.1.9_LGT0.3.x_Alfawise_Ux0Pro

U20_Pro and U30_Pro 3D Printer Firmware
GNU General Public License v3.0
26 stars 21 forks source link

Fix LGT_SCR.cpp "iteration 27 invokes undefined behavior" compilation… #5

Closed ldenisey closed 4 years ago

ldenisey commented 4 years ago

When compiling with Arduino 1.8.9, I get the following warning :

sketch\LGT_SCR.cpp:401:44: warning: iteration 27 invokes undefined behavior [-Waggressive-loop-optimizations] data_storage[6 + i] = card.longFilename[i]; ^

Indeed, when looking at it, longFilename is defined here : https://github.com/LONGER3D/Marlin1.1.9_LGT0.3.x_Alfawise_Ux0Pro/blob/master/Marlin/cardreader.h#L122, with a size of 27 : https://github.com/LONGER3D/Marlin1.1.9_LGT0.3.x_Alfawise_Ux0Pro/blob/master/Marlin/SdFatConfig.h#L114