-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 a check that warns about using %p printf specifier #43453
Comments
@llvm/issue-subscribers-good-first-issue |
I have reproduce the issue. Check on windows and linux with the compiler clang and gcc. |
Submitted patch for review https://reviews.llvm.org/D139604 |
@llvm/issue-subscribers-clang-static-analyzer |
On mac i used the command
I got no error
Code for the eg.cpp
|
Hi @aabhinavg. That is because the my commit was not accepted. I have not had the time to go back and fix the requests needed to land the patch due to school. |
Extended Description
Recently I ran into some surprising behavior surrounding the use of %p in a printf call. On Windows %p with a nullptr prints zeros, but on Linux %p with a nullptr prints "(nil)". This is surprising, but conforming to the standard which states (roughly) that the result of %p is implementation dependent.
Create a check that warns about the potential non-portable output when using %p in a printf or scanf specifier.
The text was updated successfully, but these errors were encountered: