You ar comparing batteryVoltage to a float and then treat it as a bool.
In that second occurrence, any other value than 0.00000 will evaluate to true.
It is not good practice to compare a float to an exact number.
Consider batteryVoltage > 0.01.
It is not an error but warning that is turned into error with -Werror flag. Makes sense if you are a big company and don’t want someone commit the code that has warnings, are you a big company?
Because warnings are informative, errors are blockers. making warnings blockers is authoritarian unless you did it to yourself. The whole philosophy of C++ is let the user screw up on their own accord and herein lies freedom. If one wants holding hands language they can switch