Closed evandrocoan closed 4 years ago
volatile_cast_test.cpp
#include "tinyformat.h" int main(int argc, char const *argv[]) { volatile unsigned int wait_time = 10; std::cerr << tfm::format( "Volatile '%s'\n", wait_time ) << std::endl; return 0; }
g++ -o main volatile_cast_test.cpp && ./main
In file included from volatile_cast_test.cpp:2:0: tinyformat.h: In instantiation of ‘tinyformat::detail::FormatArg::FormatArg(const T&) [with T = volatile unsigned int]’: tinyformat.h:966:32: required from ‘tinyformat::detail::FormatListN<N>::FormatListN(const Args& ...) [with Args = {volatile unsigned int}; int N = 1]’ tinyformat.h:1019:20: required from ‘tinyformat::detail::FormatListN<sizeof... (Args)> tinyformat::makeFormatList(const Args& ...) [with Args = {volatile unsigned int}]’ tinyformat.h:1055:37: required from ‘void tinyformat::format(std::ostream&, const char*, const Args& ...) [with Args = {volatile unsigned int}; std::ostream = std::basic_ostream<char>]’ tinyformat.h:1064:11: required from ‘std::__cxx11::string tinyformat::format(const char*, const Args& ...) [with Args = {volatile unsigned int}; std::__cxx11::string = std::__cxx11::basic_string<char>]’ volatile_cast_test.cpp:7:60: required from here tinyformat.h:509:23: error: invalid static_cast from type ‘const volatile unsigned int*’ to type ‘const void*’ : m_value(static_cast<const void*>(&value)),
Thanks for the report, I think this should be fixed by #62.
volatile_cast_test.cpp
g++ -o main volatile_cast_test.cpp && ./main