User Activity

  • Posted a comment on discussion Development on cppcheck

    Hello, I encounter a case where cppcheck complain about a unsignedLessThanZero in a bit of code that is (for this case) in the code block of a constexpr false if: uint32_t u32 = 4096u; if constexpr (std::numeric_limits<uint32_t>::is_signed) // same result with if constexpr (false) { if(u32 < 0) {} //FP: Checking if unsigned expression 'u32' is less than zero. [unsignedLessThanZero] } (real code is templated and the type can be signed). While it is true that, out of context, u32 < 0 should return...

  • Posted a comment on discussion General Discussion on cppcheck

    Damn, that was quick! Thanks.

  • Modified a comment on discussion General Discussion on cppcheck

    Hello, In a bit of code involving multiple inheritance and nested classes I have an issue where cppcheck don't attribute the proper inheritance and think two independant classes are based/derived from each other. The issue can be seens with the following code with 2.10 and current head of main. class A { public: class Nested { public: virtual ~Nested() = default; }; }; class B { public: class Nested { public: virtual ~Nested() = default; }; }; class C : public A, public B { public: class Nested :...

  • Modified a comment on discussion General Discussion on cppcheck

    Hello, In a bit of code involving multiple inheritance and nested classes I have an issue where cppcheck don't attribute the proper inheritance and think two independant classes are based/derived from each other. The issue can be seens with the following code with 2.10 and current head of main. class A { public: class Nested { virtual ~Nested() = default; }; }; class B { public: public: class Nested { public: virtual ~Nested() = default; }; }; class C : public A, public B { public: class Nested :...

  • Posted a comment on discussion General Discussion on cppcheck

    Hello, In a bit a code involving multiple inheritance and nested classes I have an issue where cppcheck don't attribute the proper inheritance and think two independant classes are based/derived from each other. The issue can be seens with the following code with 2.10 and current head of main. class A { public: class Nested { virtual ~Nested() = default; }; }; class B { public: public: class Nested { public: virtual ~Nested() = default; }; }; class C : public A, public B { public: class Nested :...

  • Modified a comment on discussion General Discussion on cppcheck

    It's a kind of false positive I seen when dealing with multi-threading protection. I can provide a code example that also trigger the issue: void func() { static int i = 0; static std::mutex mutex; if( i == 0) { std::lock_guard<std::mutex> lock(mutex); if( i == 0 ) // <= Complain about identicalInnerCondition { i = 1; } } } Which would be true for a mono-threaded process or a non-static local variable. But in the case of concurrent call to func(), i could have change between the two if's.

  • Posted a comment on discussion General Discussion on cppcheck

    It's a kind of false positive I seen when dealing with multi-threading protection. I can provide a code example that also trigger the issue: void func() { static int i = 0; static std::mutex mutex; if( i == 0) { std::lock_guard<std::mutex> lock(mutex); if( i == 0 ) // <= Complain about identicalInnerCondition { i = 1; } } } Which would be true for a mono-threaded process or a non-static local variable. But in the case of concurrent call to func(), i could have change between the to if's.

  • Posted a comment on discussion General Discussion on cppcheck

    It will propably take some days before I have the time do do a proper pull request but there should be no problem.

View All

Personal Data

Username:
lgimbert
Joined:
2019-08-19 11:22:15

Projects

  • No projects to display.

Personal Tools