windows.cfg: Add CRITICAL_SECTION handling functions.#1023
windows.cfg: Add CRITICAL_SECTION handling functions.#1023danmar merged 4 commits intocppcheck-opensource:masterfrom
Conversation
|
what would happen if CRITICAL_SECTION is defined as a pointer something like: that might be a quick hack that works at the moment, but in the long term maybe we should allow the struct. |
|
I probably implemented this check. But I don't remember how it's supposed to work. |
|
Even when defining CRITICAL_SECTION as a void pointer cppcheck still complains when the resource configuration exists. I run it with |
|
AppVeyor Build failed because github was temporarily not reachable during the build. |
# Resolved Conflicts: # cfg/windows.cfg
|
Since there seems to be no further improvements possible at the moment i suggest to merge this PR. |
|
ok I merged it. Feel free to create a ticket. |
I have some problems configuring the CRITICAL_SECTION functions:
How should i define CRITICAL_SECTION for cppcheck?
It is a struct and only used internally by Windows and looks like this:
I guess the checks will not detect as much as they could if this is not known to cppcheck.
Since a CRITICAL_SECTION is some sort of resource i wanted to add a resource description:
But for code like this:
cppcheck complains:
error:autovarInvalidDeallocation:The deallocation of an auto-variable results in undefined behaviour. You should only free memory that has been allocated dynamically.
Is there a way to tell cppcheck that there is no "real" allocation/deallocation but init/deinit here?