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

CMake: fix -Wint-conversion warning (error if clang is used as MPIC_C) #777

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

band-a-prend
Copy link
Contributor

@band-a-prend band-a-prend commented May 27, 2023

Using of single quotes for printf argument within MPI_C check of CMakeLists.txt results in warning of conversion to int. The single quotes is used for char/int but not for char* type where the double quotes should be used.

If clang is used as MPI_C instead of gcc the configuration is failed with error:
incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-Wint-conversion]

(refer Gentoo [guru overlay] issue:https://bugs.gentoo.org/888009)

coverage on master
Codecov branch

Summary of changes

Fix -Wint-conversion warning that results in CMake configuration error if clang is used as MPI_C compiler.

Rationale for changes

The presence of downstream issue (Gentoo Linux [guru overlay]): https://bugs.gentoo.org/888009

Additional info and certifications

This pull request (PR) is a:

  • Bug fix
  • Feature addition
  • Other, Please describe:

I certify that

  • I certify that:
    • I have reviewed and followed the contributing guidelines
    • I will wait at least 24 hours before self-approving the PR to give another
      OpenCoarrays developer a chance to review my proposed code
    • I have not introduced errant white space (no trailing white space or white space errors may
      be introduced)
    • I have added an explanation of what these changes do and why they should be included
    • I have checked to ensure there aren't other open Pull Requests for the same change
    • I have you written new tests for these changes
    • I have successfully tested these changes locally
    • I have commented any non-trivial, non-obvious code changes
    • The commits are logically atomic, self consistent and coherent
    • The commit messages follow best practices
    • Test coverage is maintained or increased after this is merged

Code coverage data

coverage on master

Using of single quotes for printf argument within MPI_C check
of CMakeLists.txt results in warning of conversion to int.
The single quotes is used for char/int but not for char* type
where the double quotes should be used.

If clang is used as MPI_C instead of gcc the configuration is failed
with error:
incompatible integer to pointer conversion passing 'int'
to parameter of type 'const char *' [-Wint-conversion]

(refer Gentoo [guru overlay] issue: https://bugs.gentoo.org/888009)

Signed-off-by: Sergey Torokhov <[email protected]>
Copy link
Collaborator

@zbeekman zbeekman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks and sorry for the slow response!

Copy link
Collaborator

@zbeekman zbeekman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zbeekman zbeekman merged commit f521b5f into sourceryinstitute:main Jan 12, 2024
@band-a-prend band-a-prend deleted the cmake_mpi_c branch January 21, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants