Luis,

With some low frequency we remove warnings from the code. In this
particular instance the meaning of the code is correct, the ompi_info_t
structure starts with an opal_info_t, but removing the warnings is good
policy.

In general we can either cast the ompi_info_t pointer directly to an
opal_info_t pointer, or access the super field in the ompi_info_t structure
(as it is done in ompi/mpi/c/win_create_dynamic.c). As in this instance we
are explicitly using one of the MPI predefined info keys (without
equivalent at the OPAL level) it is more clear if we cast it.

  George.


On Fri, May 15, 2020 at 6:37 AM Luis via devel <devel@lists.open-mpi.org>
wrote:

> Hi OMPI devs,
>
> I was wondewring if this warning is expected, if not, how should we
> internally call ompi_win_create_dynamic?
>
> res = ompi_win_create_dynamic(MPI_INFO_NULL, comm, &win);
>                                  ^~~~~~~~~~~~~
> In file included from pnbc_osc_internal.h:40,
>                  from pnbc_osc_iallreduce.c:21:
> ../../../../ompi/win/win.h:143:42: note: expected ‘opal_info_t *’ {aka
> ‘struct opal_info_t *’} but argument is of type ‘struct ompi_info_t *’
>  int ompi_win_create_dynamic(opal_info_t *info, ompi_communicator_t
> *comm, ompi_win_t **newwin);
>
>
> Regards,
> Luis
> The University of Edinburgh is a charitable body, registered in Scotland,
> with registration number SC005336.
>

Reply via email to