ZipCPU / sdspi

SD-Card controller, using either SPI, SDIO, or eMMC interfaces
207 stars 34 forks source link

C++ undefined behavior #4

Closed mjc0608 closed 4 years ago

mjc0608 commented 4 years ago

At autotest_tb.cpp:218, this function with return type unsigned does not have a return value. This is undefined behavior of C++. When using g++ 10.2 and -O1, it will be optimized to an infinite loop and trigger an assertion later.

Add "return r;" to the end of the function can solve the problem.

ZipCPU commented 4 years ago

Fixed in ed2e35d.

Thank you!