Skip to content

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

Merged
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:fix-scanf-fp-2
Jan 30, 2024
Merged

C++: Fix another FP in cpp/incorrectly-checked-scanf#15460
MathiasVP merged 4 commits into
github:mainfrom
MathiasVP:fix-scanf-fp-2

Conversation

@MathiasVP

@MathiasVP MathiasVP commented Jan 29, 2024

Copy link
Copy Markdown
Contributor

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