I suggest you ...

Stop reporting 948 for expressions in C++11 static_assert()'s

Since C++11, static_assert can be used to express conditions which have to be met at compile time and PC-lint claims to support this since version 9.00k.

But even with 9.00L with co-msc110, env-vc10 and au-misra-cpp, the following code will trigger a 948:

static const size_t SOME_SIZE = 42U;
static_assert( SOME_SIZE < 100U, "..." ); // Triggers Note 948: Operator '<' always evaluates to True

This should not be reported, as this is exactly the point of static_assert to always evaluate to true!

8 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Simon Lehmann shared this idea  ·   ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base