Skip to content

Commit 3270274

Browse files
committed
Initialize variable declared by OMPI_ARRAY_NAME_DECL
The compiler will otherwise complain about potentially uninitialized variables. Signed-off-by: Joseph Schuchart <[email protected]>
1 parent b67136e commit 3270274

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ompi/mpi/fortran/base/fint_2_int.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434

3535
#if OMPI_SIZEOF_FORTRAN_INTEGER == SIZEOF_INT
36-
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
36+
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL
3737
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2]
3838
#define OMPI_SINGLE_NAME_DECL(a)
3939
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a
@@ -50,7 +50,7 @@
5050
#define OMPI_ARRAY_INT_2_FINT(in, n)
5151

5252
#elif OMPI_SIZEOF_FORTRAN_INTEGER > SIZEOF_INT
53-
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
53+
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL
5454
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2], dim2_index
5555
#define OMPI_SINGLE_NAME_DECL(a) int c_##a
5656
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a
@@ -107,7 +107,7 @@
107107
free(OMPI_ARRAY_NAME_CONVERT(in)); \
108108
} while (0)
109109
#else /* int > MPI_Fint */
110-
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a
110+
#define OMPI_ARRAY_NAME_DECL(a) int *c_##a = NULL
111111
#define OMPI_2_DIM_ARRAY_NAME_DECL(a, dim2) int (*c_##a)[dim2], dim2_index
112112
#define OMPI_SINGLE_NAME_DECL(a) int c_##a
113113
#define OMPI_ARRAY_NAME_CONVERT(a) c_##a

0 commit comments

Comments
 (0)