Skip to content
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 2 commits into from
Jan 27, 2023

Conversation

IlanTruanovsky
Copy link
Contributor

For the copy paste error, the supporting comment (and a brief look over the code) makes me believe this was intentional.

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?

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.]

@IlanTruanovsky IlanTruanovsky self-assigned this Jan 26, 2023
@IlanTruanovsky IlanTruanovsky added the bug Something isn't working label Jan 26, 2023
@IlanTruanovsky IlanTruanovsky added this to the 2023.2 milestone Jan 26, 2023
Copy link
Contributor

@pcolberg pcolberg left a 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.]
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?
@pcolberg pcolberg merged commit 487c7ef into intel:main Jan 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants