Skip to content

Commit c68976d

Browse files
committed
Remove warnings about compare to self
Create temporary variables to store the array pointer such that we compare the pointer with the temporary variable and prevent picky compiler for complaining about a totally legitimate code. Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
1 parent ee16107 commit c68976d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

ompi/mpi/fortran/base/fint_2_int.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* Copyright (c) 2012 Oracle and/or its affiliates. All rights reserved.
1414
* Copyright (c) 2014-2019 Research Organization for Information Science
1515
* and Technology (RIST). All rights reserved.
16+
* Copyright (c) 2024 NVIDIA Corporation. All rights reserved.
1617
* $COPYRIGHT$
1718
*
1819
* Additional copyrights may follow
@@ -32,17 +33,17 @@
3233
*/
3334

3435
#if OMPI_SIZEOF_FORTRAN_INTEGER == SIZEOF_INT
35-
#define OMPI_ARRAY_NAME_DECL(a)
36-
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2)
36+
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
37+
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2]
3738
#define OMPI_SINGLE_NAME_DECL(a)
38-
#define OMPI_ARRAY_NAME_CONVERT(a) a
39+
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a
3940
#define OMPI_SINGLE_NAME_CONVERT(a) a
4041
#define OMPI_INT_2_FINT(a) a
4142
#define OMPI_FINT_2_INT(a) a
4243
#define OMPI_PFINT_2_PINT(a) a
43-
#define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n)
44-
#define OMPI_ARRAY_FINT_2_INT(in, n)
45-
#define OMPI_2_DIM_ARRAY_FINT_2_INT(in, n, dim2)
44+
#define OMPI_ARRAY_FINT_2_INT_ALLOC(in, n) { OMPI_ARRAY_NAME_CONVERT(in) = in; }
45+
#define OMPI_ARRAY_FINT_2_INT(in, n) { OMPI_ARRAY_NAME_CONVERT(in) = in; }
46+
#define OMPI_2_DIM_ARRAY_FINT_2_INT(in, n, dim2) { OMPI_ARRAY_NAME_CONVERT(in) = in; }
4647
#define OMPI_ARRAY_FINT_2_INT_CLEANUP(in)
4748
#define OMPI_SINGLE_FINT_2_INT(in)
4849
#define OMPI_SINGLE_INT_2_FINT(in)

0 commit comments

Comments
 (0)