-
Notifications
You must be signed in to change notification settings - Fork 487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dashboard: bad warning for return without value. #2073
Comments
Will probably be solved by: #2020 |
Indeed, thanks. |
You know Win is quit forgiving but these Unix based system are sometimes idiosyncratic. (Nice word I found or?) |
Don't know about the word. But the more bugs the compiler catches, the better. And this is definitely a bug. So we are lucky building on multiple platforms so we can get these kind of warnings from many compilers. Does this really pass mscv without warnings? If so, it's kind of interesting to think about the code it generated ;) |
Yes it compiles fine using VS2017 but I got the warning when tested the patch on my RPi |
It's interesting, but not interesting enough to review the emitted code. That said, I couldn't really fathom would that would be.. |
This would be a no problem I suppose. Most code are more or less tested on all system. Well, I've no Mac so can't test on that but if in doubts I use to ask for it. |
Tested or not, I cannot imagine what code a compiler would generate for
We can of course make sure that we never call this function with an argument in the 10..100 range. But, what's in the the relevant register (or on the stack) at the end of that function is undefined, and so is the function value. This is a bug on any compiler, and if mscv does not emit a warning for it it's IMHO a bug in msvc. OTOH, IIRC some warnings are disabled in the builds; perhaps this is the reason |
VS2017 says: warning C4715: 'foo': not all control paths return a value |
Yes, this is the sane thing to do
No way, only a really dumb compiler does that. There are no provisions in the C++ standard for it, and a compiler should implement the standard. Return NaN in this scenario could cause all sort of surprises for the calling code, surprises you cannot understand when reading the code. |
OK sound fair. But now we're over my head. Nice chat. End? |
Right. Have a nice weekend :) |
"idiosyncratic" |
fixed in #2020. closing |
As heading says:
Nasty one, this. Will be patched using attached patch in Debian package
0006-dashboard_pi-Handle-return-without-value-warning.patch.gz
The text was updated successfully, but these errors were encountered: