mpusz / mp-units

The quantities and units library for C++
https://mpusz.github.io/mp-units/
MIT License
998 stars 79 forks source link

unmanned_aerial_vehicle.cpp:62:1: error: control reaches end of non-void function [-Werror=return-type] #478

Closed bourumir-wyngs closed 11 months ago

bourumir-wyngs commented 11 months ago

While as seen by human control would not reach the end of this function, as it contains switch statement with all cases of enum, my compiler that is 12.3.1 20230730 anyway responds with the error as given in the title.

The glitch can be fixed by adding assertion statement to the end of the function (assert (false & "why"), as proposed in the path. Let's agree if we want to fix it this way, some other way or not to fix. I can then open a pull request.

path.txt

mpusz commented 11 months ago

Sure, please provide the PR.

bourumir-wyngs commented 11 months ago

Here it is: https://github.com/mpusz/mp-units/pull/480

mpusz commented 11 months ago

Merged. Thanks!