Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create c style math function ltgm query #39388

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

There have been perennial problems caused by invoking c-style match functions such as floor() and exp() instead of the equivalent c++ style functions such as std::floor() and std::exp().
Most recently they triggered a large number of lgtm.com warnings (just noise) due to the fact that the c-style variants do not have float overloads while the c++ style equivalents do.

Describe the solution

Add this query to mark new instances of these functions to discourage their proliferation.

Describe alternatives you've considered

The listing is incomplete, the full list of functions is quite extensve, see cppreference.com, I'll add more later.

Testing

Let lgtm do its thing.

Additional context

I'm interested to see what over checks we can use this for, it seems very flexible and easy to use.
See https://lgtm.com/help/lgtm/writing-custom-queries for the outline of adding them.

@kevingranade kevingranade merged commit 59d1fda into master Apr 9, 2020
@kevingranade kevingranade deleted the kevingranade-c-style-math-functions-query branch April 9, 2020 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant