summaryrefslogtreecommitdiff
path: root/src/plugin.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-10 02:04:22 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-10 02:22:33 +0300
commit4e5bece0cc29f7068c5c46c173d385f3e6e75482 (patch)
treee74707a7372f99e471fc84e3a5936778168ae4d7 /src/plugin.cpp
parent9a99b7ca6d59b3f9d19c05b5512b5cc3efd6a5a0 (diff)
downloadparanucker-4e5bece0cc29f7068c5c46c173d385f3e6e75482.tar.gz
paranucker-4e5bece0cc29f7068c5c46c173d385f3e6e75482.tar.bz2
paranucker-4e5bece0cc29f7068c5c46c173d385f3e6e75482.tar.xz
paranucker-4e5bece0cc29f7068c5c46c173d385f3e6e75482.zip
Disable check for useless checks in second check in while condition.
This fix false positive in this example: while(ptr) { ... }
Diffstat (limited to 'src/plugin.cpp')
-rw-r--r--src/plugin.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/plugin.cpp b/src/plugin.cpp
index c1d9b18..cf611f5 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -40,6 +40,12 @@ Command command = Command::DetectNullPointers;
std::map<tree, Node*> foundNodesMap;
std::map<Node*, Node*> updateNodesMap;
+Command operator |(const Command &cmd1, const Command &cmd2)
+{
+ return static_cast<Command>(static_cast<int>(cmd1)
+ | static_cast<int>(cmd2));
+}
+
static void pre_generic(void *gcc_data,
void *user_data A_UNUSED)
{
@@ -94,11 +100,13 @@ int plugin_init (struct plugin_name_args *plugin_info,
}
else if (cmd == "detectnullpointers")
{
- command = Command::DetectNullPointers;
+ command = Command::DetectNullPointers |
+ Command::DetectUseless;
}
else if (cmd == "dumpnullpointers")
{
- command = Command::DumpNullPointers;
+ command = Command::DumpNullPointers |
+ Command::DetectUseless;
}
else
{