Skip to content
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

Warning: Function declared 'noreturn' should not return when using RETURN_IF_FAILED macro in clang #79

Closed
giuntnic opened this issue Aug 6, 2019 · 2 comments

Comments

@giuntnic
Copy link
Contributor

giuntnic commented Aug 6, 2019

Compiling
`
#include "wil\result.h"

volatile bool debug = false;

HRESULT test_func()
{
if(debug)
{
return E_FAIL;
}
return S_OK;
}

int main(void)
{
RETURN_IF_FAILED(test_func());
return 0;
}`

with Clang gives
In file included from ../..\..\wil\result.h:16: ../..\..\wil/result_macros.h(4256,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4262,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4268,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4274,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4288,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4294,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4300,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4306,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4312,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4480,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4488,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4496,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4504,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4520,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4526,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4532,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4538,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4544,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4742,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4748,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4798,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ ../..\..\wil/result_macros.h(4804,13): warning: function declared 'noreturn' should not return [-Winvalid-noreturn] } ^ 22 warnings generated.

@metathinker
Copy link
Contributor

It looks like you might have fixed this issue with PR #80 ; is that right?

@giuntnic
Copy link
Contributor Author

Correct, this should be resolved with that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants