lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] [PATCH] More clang [[noreturn]] changes


From: Vadim Zeitlin
Subject: [lmi] [PATCH] More clang [[noreturn]] changes
Date: Fri, 14 Apr 2017 19:13:19 +0200

 Hello,

 Sorry for not submitting both of them together with the other changes
before, but it turns out there are more instances of the same "[[noreturn]]
used in function definition and not declaration" problem, so here are two
more patches fixing them and allowing me to fully build lmi with clang.

 The first patch should be uncontroversial as it just moves the attribute
from the function definition to its declaration. The only possible problem
here is that I'm not sure how is this code supposed to be formatted with
lmi conventions.

 The second one is potentially more problematic, as it just removes the use
of the attribute with the value_cast<> template specializations, meaning
that gcc will now give warnings about possibly missing "noreturn" here with
-Wsuggest-attribute=noreturn. However I hope we can live with these
warnings (not resulting in errors, of course, as this flag is not used by
default), while we definitely can't live with clang errors, if we want to
use this compiler. The only other solution I can see is adding a
NORETURN_IF_NOT_CLANG macro with the obvious meaning, but I don't think
it's worth doing this just to avoid the -Wsuggest-attribute=noreturn
warning. But please let me know if you disagree.

 Thanks in advance,
VZ

Attachment: 0001-Move-noreturn-attribute-to-declaration-from-definiti.patch
Description: Text document

Attachment: 0002-Remove-noreturn-attribute-from-template-specializati.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]