From 6f7612de033bc9e4400491901c785f3537e6834c Mon Sep 17 00:00:00 2001 From: versat Date: Fri, 15 Mar 2019 11:13:08 +0100 Subject: [PATCH] boost.cfg: Add argument directions; some fixes; rearrange and document. - Remove redundant function configurations for the same function since it is not (yet) possible to configure overloaded functions. Instead mark the optional arguments with `default="0"` so the configuration works with a different number of arguments. - Add documentation to boost.cfg (links and function declarations). - Rearranged configurations so functions, defines, ... are together now. - Add `direction` for function arguments where applicable. - Add some tests to boost.cpp. --- cfg/boost.cfg | 366 +++++++++++++++++++++++++++------------------ test/cfg/boost.cpp | 29 ++++ 2 files changed, 250 insertions(+), 145 deletions(-) diff --git a/cfg/boost.cfg b/cfg/boost.cfg index 6f503779b..1469a10d0 100644 --- a/cfg/boost.cfg +++ b/cfg/boost.cfg @@ -1,19 +1,8 @@ - - false - - - - - - - - - - - - + + + @@ -35,41 +24,80 @@ + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + false - + - + + + + + false - + + + false arg1==0?0:(arg1<0?-1:1) - + + false @@ -81,28 +109,34 @@ + false - + - + + + + + + + + false + + + + - - false - - - - x - + false @@ -580,261 +614,303 @@ 7.978845608028653558798921198687637369e-01 + + + false - + + + + + + + false - + + + + + + + false - + + + + + + + false - + + + + + + + + + + + + + false - - - - - - false - - - - - - - - + + + + + + + false - + - + + - - - false - - - - - - + + - - - - - + + + false - + + + + + - + + + false - - + + + - - + + - + + + + + + + false - + + - + + + + + - + + + + + false - + + - + + + + + + + + - + + + + false - + + + + + - - false - - - - - - - - + + + + + + + + false - + + - + + - - - false - - - - + + - - - - + + + + + + + + + + + + + + + false - + + + + + + + + + + + + + + false - + - - - false - - - - - - + + - - - - - - - - - - - false - - - - - - - - - - - - - + + + + + false - + + + + + + - - - - - - - - - - - diff --git a/test/cfg/boost.cpp b/test/cfg/boost.cpp index 8f1e2205a..cfb40dd7f 100644 --- a/test/cfg/boost.cpp +++ b/test/cfg/boost.cpp @@ -8,6 +8,8 @@ // #include +#include +#include BOOST_FORCEINLINE void boost_forceinline_test() @@ -28,4 +30,31 @@ void valid_code() } if (BOOST_UNLIKELY(0)) { } + + int int1 = 5; + boost::endian::endian_reverse_inplace(int1); +} + +void ignoredReturnValue(char * buf) +{ + // cppcheck-suppress ignoredReturnValue + boost::math::round(1.5); + // cppcheck-suppress ignoredReturnValue + boost::math::iround(1.5); + // cppcheck-suppress ignoredReturnValue + boost::math::lround(1.5); + // cppcheck-suppress ignoredReturnValue + boost::math::llround(1.5); + // cppcheck-suppress ignoredReturnValue + boost::endian::endian_reverse(1); +} + +void uninitvar() +{ + int intUninit1; + int intUninit2; + // cppcheck-suppress uninitvar + boost::endian::endian_reverse_inplace(intUninit1); + // cppcheck-suppress uninitvar + (void)boost::math::round(intUninit2); }