Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build in Visual Studio IDE is broken #79

Open
christiandaley opened this issue Jan 21, 2024 · 2 comments
Open

Build in Visual Studio IDE is broken #79

christiandaley opened this issue Jan 21, 2024 · 2 comments

Comments

@christiandaley
Copy link

Building intro.exe using Visual Studio IDE (17.8.5) is broken due to warnings emitted by clang-tidy and cppcheck. There are also compile errors involving lefticus::tools. Building on the command line using CMake seems to work.

  1. clang-tidy complains about many missing includes (misc-include-cleaner) in main.cpp:
    image
  2. The compiler (both cl and clang-cl) throws an error when attempting to add an int literal to a lefticus::tools::uint_np8_t:
    image
    image
  3. cppcheck issues warnings (treated as errors) when checking the constexpr tests:
    image

There are other build issues as well, such as Debug builds being broken due to the use of address sanitizer with the -MDd compiler option (see #59). I realize that perhaps building was intended to be done from the command line with this template (as mentioned before, command line builds seem to work), but when developing on windows being able to make use of Visual Studio for editing and running/debugging my code is important. This template should be made compatible with Visual Studio IDE builds.

@cblck
Copy link

cblck commented Jan 22, 2024

Having also encountered the reported issues I've submitted pull request #80 which resolves issue 1 by excluding 'misc-include-cleaner' as an error if warnings-as-errors is enabled and issue 3 by adding 'cppcheck-suppress knownConditionTrueFalse' comments to those cases.

Issue 2:
E0349: C++ no operator matches these operands
operand types are: lefticus::tools::uint_np8_t += int
built-in operator+=(<arithmetic>, <promoted arithmetic>) does not match because argument #1 does not match parameter
built-in operator+=(<pointer to object>, <ptrdiff_t>) does not match because argument #1 does not match parameter

As best as I can tell, IntelliSense failing to satisfy the std::integral concept in constexpr int_np &operator+=(const std::integral auto rhs) &noexcept with an int despite the code compiling as expected during the build. Any additional insight anyone can provide would be greatly appreciated.

@cblck
Copy link

cblck commented Feb 2, 2024

Issue 2:
I've submitted pull request #81 (wrap external headers in #pragma diag_suppress) and lefticus::tools #8 (move declaration of int_np::value) as a means to suppress the erroneous IntelliSense errors.

The last change, not submitted to lefticus::tools, can be seen here.
I'm hesitant to upstream a change that suppresses IntelliSense warning 349 anywhere non_promoting_ints.hpp is included for a best practices library, but it is good enough hack in my case utilized by changing gh:lefticus/tools#update_build_system to gh:cblck/lefticus-tools#main in Dependencies.cmake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants