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

Minor: fix msvc warning "not all control paths return a value" #5650

Merged
merged 4 commits into from
Nov 12, 2023

Commits on Nov 11, 2023

  1. Minor: fix msvc warning "not all control paths return a value"

    When building with /Od - default cmake debug build for me, the __assume(false); trick does not work to get rid of the C4714 warnings
    
    https://godbolt.org/z/a6xGnfP7d
    
    D:\tmp\cppcheck\lib\keywords.cpp(205): warning C4715: 'Keywords::getOnly': not all control paths return a value
    D:\tmp\cppcheck\lib\keywords.cpp(226): warning C4715: 'Keywords::getOnly': not all control paths return a value
    D:\tmp\cppcheck\lib\keywords.cpp(168): warning C4715: 'Keywords::getAll': not all control paths return a value
    D:\tmp\cppcheck\lib\keywords.cpp(188): warning C4715: 'Keywords::getAll': not all control paths return a value
    
    Proposed fix: also define NORETURN to [[noreturn]] when according to __has_cpp_attribute [[noreturn]] is supported https://en.cppreference.com/w/cpp/feature_test
    
    (For previous discussion see also danmar#5497)
    StefanVK committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    79b6525 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9d2d226 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2023

  1. Minor: fix msvc warning "not all control paths return a value"

    Moved __has_cpp_attribute block up to first choice. When we have a portable standard way of expressing it, that's the best choice.
    (Addresses Review Feedback from Firewave)
    StefanVK committed Nov 12, 2023
    Configuration menu
    Copy the full SHA
    7bcdf4a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b3e07d4 View commit details
    Browse the repository at this point in the history