sparkfun/SparkFun_LSM9DS1_Arduino_Library

Warnings in SparkFunLSM9DS1.cpp due to missing return statement

Miautomat opened this issue · 1 comments

These warnings will stop compilation unless you ignore them in your properties - at least using eclipse IDE with sloeber v4 plugin.

To make it work I needed to add "else return -1/or anything else" for the method in Line 1047 and the following 2 methods.
I don't know why this warning doesn't occur in the other methods as well - as I'm still a student I might not have the knowledge to unterstand why not using a default return statement is useful in this case.

Thank you for your comment. I've updated those methods so that they will return a default value and should no longer produce warnings during compilation. The reason these methods produced a warning and the others did not is because in the definition of these methods they are required to return an unsigned 8 bit integer (unint8_t) whereas the other methods did not a require any value to be returned (void). Please let me know if you have any further questions or if you see any more problems like this.