Skip to content

Commit ade0422

Browse files
committed
CMake: fix -Wint-conversion warning (error if clang is used as MPIC_C)
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]>
1 parent d8f4657 commit ade0422

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ int main(int argc, char** argv) {
422422
char processor_name[MPI_MAX_PROCESSOR_NAME];
423423
int name_len;
424424
MPI_Get_processor_name(processor_name, &name_len);
425-
printf('Hello world from processor %s, rank %d out of %d processors',
425+
printf(\"Hello world from processor %s, rank %d out of %d processors\",
426426
processor_name, world_rank, world_size);
427427
MPI_Finalize();
428428
}"

0 commit comments

Comments
 (0)