Skip to content

C++: Fix another FP in cpp/incorrectly-checked-scanf #15460

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

Merged
merged 4 commits into from
Jan 30, 2024

Conversation

MathiasVP
Copy link
Contributor

@MathiasVP MathiasVP commented Jan 29, 2024

Fixes #15415 by correctly identifying that scanf(...) >= 0 also implies that scanf(...) != EOF (because the C standard specifies that EOF is negative).

As with #15456, this moves the FP to the cpp/missing-check-scanf query. I suggest we fix that one in a future PR.

@MathiasVP MathiasVP merged commit 436a9ce into github:main Jan 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive and misleading diagnostic on scanf
2 participants