Skip to content

Commit c3bebd8

Browse files
authored
Merge pull request #12685 from devreal/fix-compiler-warnings
Fix some compiler warnings
2 parents e82f918 + 41a1a2f commit c3bebd8

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

ompi/communicator/comm.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,10 +1509,7 @@ static int ompi_comm_idup_with_info_activate (ompi_comm_request_t *request)
15091509

15101510
static int ompi_comm_idup_with_info_finish (ompi_comm_request_t *request)
15111511
{
1512-
ompi_comm_idup_with_info_context_t *context =
1513-
(ompi_comm_idup_with_info_context_t *) request->context;
1514-
1515-
/* done */
1512+
/* nothing to be done */
15161513
return MPI_SUCCESS;
15171514
}
15181515

ompi/mca/coll/base/coll_base_allreduce.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1281,7 +1281,6 @@ int ompi_coll_base_allreduce_intra_allgather_reduce(const void *sbuf, void *rbuf
12811281
ptrdiff_t extent, lb;
12821282
ompi_datatype_get_extent(dtype, &lb, &extent);
12831283

1284-
int rank = ompi_comm_rank(comm);
12851284
int size = ompi_comm_size(comm);
12861285

12871286
sendtmpbuf = (char*) sbuf;
@@ -1337,7 +1336,7 @@ int ompi_coll_base_allreduce_intra_allgather_reduce(const void *sbuf, void *rbuf
13371336
tmpsend_start = NULL;
13381337
}
13391338
OPAL_OUTPUT((ompi_coll_base_framework.framework_output, "%s:%4d\tError occurred %d, rank %2d",
1340-
__FILE__, line, err, rank));
1339+
__FILE__, line, err, ompi_comm_rank(comm)));
13411340
(void)line; // silence compiler warning
13421341
return err;
13431342

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

opal/mca/smsc/xpmem/smsc_xpmem_component.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ static int mca_smsc_xpmem_component_query(void)
116116
char buffer[1024];
117117
uintptr_t address_max = 0;
118118
while (fgets(buffer, sizeof(buffer), fh)) {
119-
uintptr_t low, high;
119+
uintptr_t high;
120120
char *tmp;
121121
/* each line of /proc/self/maps starts with low-high in hexadecimal (without a 0x) */
122-
low = strtoul(buffer, &tmp, 16);
122+
strtoul(buffer, &tmp, 16);
123123
high = strtoul(tmp + 1, NULL, 16);
124124
if (address_max < high) {
125125
address_max = high;

0 commit comments

Comments
 (0)