Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

False positive related to prefix notation #7

Closed
myint opened this issue May 6, 2014 · 1 comment
Closed

False positive related to prefix notation #7

myint opened this issue May 6, 2014 · 1 comment

Comments

@myint
Copy link

myint commented May 6, 2014

The prefix notation provides no benefit for primitive types. At the very least this false positive is noise. Worse, the advise is wrong in cases where changing it results in changing program behavior.

foo.cc:

int main()
{
    int x = 0;
    x++;
}
$ ./flint++ foo.cc
===============================================================================
File foo.cc:
Errors:   0
Warnings: 0
Advice:   1
===============================================================================

Line 4: Advice

Use prefix notation '++x'.

Postfix incrementers inject a copy operation, almost doubling the workload.
@JossWhittle
Copy link
Owner

Thanks for the feedback, I've bit the bullet and removed the incrementer advice check. As you said, there's just too many chances for false positives and Flint isn't setup to be able to analyse the situation fully enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants