Warning digit1 may be used uninitialized in this function

That's a red herring - it's about execution paths. There is none that leaves digit3 unset before use because of the default case in the switch.