V3088. The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present.
The analyzer detected an expression enclosed in double parentheses. It is very likely that one of the parentheses is misplaced.
Note that the analyzer does not simply look for code fragments with double parentheses; it looks for those cases when placing one of them differently can change the meaning of the whole expression. Consider the following example:
This code looks suspicious: there is no apparent reason for using additional parentheses here. Perhaps the expression was actually meant to look like this:
Even if the code is correct, it is better to remove the extra pair of parentheses. There are two reasons:
- Those programmers who will be reading the code may be confused by the double parentheses and doubt its correctness.
- Removing the extra parentheses will make the analyzer stop reporting the false positive.
You can look at examples of errors detected by the V3088 diagnostic.