﻿# V601\. Suspicious implicit type casting\.

The analyzer has detected an odd implicit type conversion\. Such a type conversion might signal an error or carelessly written code\.

Let's consider the first example\.

```cpp
std::string str;
bool bstr;
...
str = true;
```

Any programmer will be surprised on seeing an assignment of the 'true' value to a variable of the 'std::string' type\. But this construct is quite permissible and working\. The programmer just made a mistake here and wrote a wrong variable\.

This is the correct code:

```cpp
std::string str;
bool bstr;
...
bstr = true;
```

Consider the second example:

```cpp
bool Ret(int *p)
{
  if (!p)
    return "p1";
  ...
}
```

The string literal "p1" turns into the 'true' variable and is returned from the function\. It is a very odd code\.

We cannot give you general recommendations on fixing such code, since every case must be considered individually\.