arduino-libraries / SD

SD Library for Arduino
http://arduino.cc/
GNU General Public License v3.0
182 stars 155 forks source link

Fix a compiler warning for uninitialized 'pathidx' variable #48

Closed ultr closed 4 years ago

ultr commented 6 years ago

SD.cpp:456:12: warning: 'pathidx' may be used uninitialized in this function [-Wmaybe-uninitialized] SD.cpp:450:7: note: 'pathidx' was declared here

aentinger commented 5 years ago

Might it not be better to directly initialize pathidx in the top-level-function, e.g.

-int pathidx;
+int pathidx = 0;

?

daveharrisuk commented 4 years ago

It's still ongoing...

aentinger commented 4 years ago

Sure and my suggestion has been totally ignored. Initializing the variable that much down is not very user-friendly, it would be way better to initialize at variable declaration.

daveharrisuk commented 4 years ago

Is not an issue for me now, as I've switched to SdFat.

aentinger commented 4 years ago

Closing since no longer relevant for PR author.