-
Notifications
You must be signed in to change notification settings - Fork 70
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 Coverity issues for acl_event_test.cpp
#256
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcolberg
reviewed
Jan 26, 2023
e7defe2
to
5b355b1
Compare
pcolberg
reviewed
Jan 27, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @IlanTruanovsky, the change itself is good. Could you fixup the commits so that each commit contains the change it describes? (The printf format change is currently in the copy-paste commit.) There is a trailing line a
in the copy-paste commit message.
Fixes: test/acl_event_test.cpp:903:27: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_event_test.cpp:903:27: invalid_type: Argument "queued_times[i]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.] test/acl_event_test.cpp:903:44: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_event_test.cpp:903:44: invalid_type: Argument "submit_times[i]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.] test/acl_event_test.cpp:903:61: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_event_test.cpp:903:61: invalid_type: Argument "start_times[i]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.] test/acl_event_test.cpp:904:27: Type: Invalid type in argument to printf format specifier (PRINTF_ARGS) test/acl_event_test.cpp:904:27: invalid_type: Argument "end_times[i]" to format specifier "%d" was expected to have type "int" but has type "unsigned long". src/acl_hal.cpp:123:3: path: Condition "debug_mode > 0", taking true branch. src/acl_hal.cpp:126:5: printf_function: Calling "vprintf" which uses a "printf"-style format string. [Note: The source code implementation of the function has been overridden by a builtin model.]
5b355b1
to
5d6220f
Compare
This was not a real copy paste error. We intended to have the code do what we indicated. So, our two options were to tell Coverity to ignore this line of code, or change the code slightly so Coverity doesn't recognize it as a copy-paste error. We chose to do the latter. Fixes: test/acl_event_test.cpp:918:9: Type: Copy-paste error (COPY_PASTE_ERROR) test/acl_event_test.cpp:914:9: original: "submit_times[i]" looks like the original copy. test/acl_event_test.cpp:918:9: copy_paste_error: "submit_times" in "submit_times[i]" looks like a copy-paste error. test/acl_event_test.cpp:918:9: remediation: Should it say "end_times" instead?
5d6220f
to
02979e3
Compare
pcolberg
approved these changes
Jan 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For the copy paste error, the supporting comment (and a brief look over the code) makes me believe this was intentional.
Fixes: