On Mon, Feb 13, 2012 at 3:30 AM, David Faure <fa...@kde.org> wrote:

>    This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/103832/
>
> Out of curiosity, if the method returns void anyway, why is this attribute 
> necessary? It's not like the the compiler is going to warn about the lack of 
> a return value...
>
>
>
Noreturn is not a return void.  noreturn tells the compiler that the
program will stop right there, killing the app.
The noreturn keyword tells the compiler to assume that the function/method
cannot return. It can then optimize without regard to what would happen if
it ever did return. This makes slightly better code. More importantly, it
helps avoid spurious warnings of uninitialized variables.

Tomaz

- David

>
> On January 31st, 2012, 8:58 p.m., Allen Winter wrote:
>   Review request for kdelibs.
> By Allen Winter.
>
> *Updated Jan. 31, 2012, 8:58 p.m.*
> Description
>
> This diff adds a new macro KDE_NO_RETURN that wraps the noreturn attribute 
> which is enabled differently based on the compiler.
>
>   Testing
>
> did a test compile
>
>   Diffs
>
>    - kdemacros.h.cmake (b93242c)
>
> View Diff <http://git.reviewboard.kde.org/r/103832/diff/>
>

Reply via email to