Without this change, the build fails with MSVC (2017), since Wisteria CMakefile tells the compiler to treat warnings as errors:
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1301): error C2220: warning treated as error - no 'object' file generated
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1301): warning C4834: discarding return value of function with 'nodiscard' attribute
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1301): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1317): warning C4834: discarding return value of function with 'nodiscard' attribute
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1317): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1450): warning C4834: discarding return value of function with 'nodiscard' attribute
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1450): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1672): warning C4834: discarding return value of function with 'nodiscard' attribute
1>D:\dev\Desktop\Lib\Wisteria-Dataviz-GIT\src\base\reportbuilder.cpp(1672): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
1>Done building project "Wisteria.vcxproj" -- FAILED.
Other compilers could warn when the function is just declared, not even called.
EDIT These warnings are not present in MSVS 2022 (v17.3.3). With GCC 12.2, the attribute warning is there and GCC also warns that attribute usage is incorrect in method declaration (between static and return type). There are also many other GCC warnings and not all of them are -Wreorder.
Without this change, the build fails with MSVC (2017), since Wisteria CMakefile tells the compiler to treat warnings as errors:
Other compilers could warn when the function is just declared, not even called.
EDIT These warnings are not present in MSVS 2022 (v17.3.3). With GCC 12.2, the attribute warning is there and GCC also warns that attribute usage is incorrect in method declaration (between
static
and return type). There are also many other GCC warnings and not all of them are -Wreorder.