-
Notifications
You must be signed in to change notification settings - Fork 783
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
Fix variable scope warnings #190
base: master
Are you sure you want to change the base?
Conversation
This warning has been founded by using Cppcheck 1.86. Signed-off-by: Ercan Ersoy <[email protected]>
These warnings have been founded by using Cppcheck 1.86. Signed-off-by: Ercan Ersoy <[email protected]>
Signed-off-by: Ercan Ersoy <[email protected]>
Breaks C89 compatibility. |
Some of those changes might make sense but I don't really see them as necessary. |
- Deleted unconditional integer variable definition on for loop. It is unneeded except JSMN_PARENT_LINKS option. - Added conditional integer variable definition before for loop. Signed-off-by: Ercan Ersoy <[email protected]>
Variable scope warnings can reduce optimizations. |
I don't see the point of those optimizations in the tests and doubt that the single redeclaration will matter on platforms targeted by JSMN. |
Cppcheck results of jsmn.h on your repository:
I have used Cppcheck 1.86. I have used this command line:
Reference: |
Fixed variable scope warnings on jsmn.h, test/testc.c and test/testutil.h files.
These warnings have been founded by using Cppcheck 1.86.