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

Explicitly convert function to function pointer during comparison #239

Merged
merged 1 commit into from
Jan 10, 2023

Conversation

IlanTruanovsky
Copy link
Contributor

@IlanTruanovsky IlanTruanovsky commented Jan 9, 2023

This fixes the following Coverity issue:

src/acl_support.cpp:403:34:
  Type: Function address comparison (BAD_COMPARE)

src/acl_support.cpp:403:34:
  func_conv: This implicit conversion to a function pointer is suspicious: "dlopen != NULL".
src/acl_support.cpp:403:34:
  remediation: Did you intend to call "dlopen"?

@IlanTruanovsky IlanTruanovsky self-assigned this Jan 9, 2023
@IlanTruanovsky IlanTruanovsky added the bug Something isn't working label Jan 9, 2023
@IlanTruanovsky IlanTruanovsky modified the milestones: 2023.1, 2023.2 Jan 9, 2023
@IlanTruanovsky IlanTruanovsky changed the title Change function address comparison to be done with NULL instead of 0 Change function address comparison to be done with NULL function pointer instead of 0 Jan 9, 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! Please also fix the Windows implementation of acl_dlpresent() accordingly.

@IlanTruanovsky IlanTruanovsky changed the title Change function address comparison to be done with NULL function pointer instead of 0 Change function address comparison to be done with nullptr instead of 0 Jan 10, 2023
@pcolberg
Copy link
Contributor

Thanks @IlanTruanovsky! Could you revise the commit subject accordingly? The issue here is the implicit conversion to a function pointer, not 0 versus nullptr. Since you included part of the Coverity output, please include the full Coverity trace in the commit message to provide context.

This fixes the following Coverity issue:
src/acl_support.cpp:403:34:
  Type: Function address comparison (BAD_COMPARE)

src/acl_support.cpp:403:34:
  func_conv: This implicit conversion to a function pointer is suspicious: "dlopen != NULL".
src/acl_support.cpp:403:34:
  remediation: Did you intend to call "dlopen"?
@IlanTruanovsky IlanTruanovsky changed the title Change function address comparison to be done with nullptr instead of 0 Explicitly convert function to function pointer during comparison Jan 10, 2023
@pcolberg pcolberg merged commit 96630bc into intel:main Jan 10, 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