Skip to content

Conversation

@jsquyres
Copy link
Member

@jsquyres jsquyres commented Oct 1, 2021

Signed-off-by: Jeff Squyres [email protected]

@bwbarrett I note two additional warnings in OFI common that this PR does not fix:

  1. From the Coverity build last night -- I don't know if this has something to do with the version of libfabric used with the Coverity build...?
common_ofi.c: In function ‘opal_common_ofi_export_memory_monitor’:
common_ofi.c:116:16: error: ‘FI_ENOSYS’ undeclared (first use in this function); did you mean ‘ENOSYS’?
 116 |     int ret = -FI_ENOSYS;
     |                ^~~~~~~~~
     |                ENOSYS
common_ofi.c:116:16: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [Makefile:1539: common_ofi.lo] Error 1
make[2]: Leaving directory '/mnt/data/nightly-tarball/scratch/openmpi/master-202110010241/openmpi-master-202110010241-374e5c9/opal/mca/common/ofi'
  1. This is from my own build of master. I don't quite know how to fix this, because the PMIX macro is checking one of the macro parameters for NULL, but that particular macro parameter is &locality_string, which will obviously never be NULL:
  CC       common_ofi.lo
In file included from ../../../../opal/util/proc.h:26:0,
                 from common_ofi.h:21,
                 from common_ofi.c:28:
common_ofi.c: In function ‘get_package_rank’:
../../../../opal/mca/pmix/pmix-internal.h:304:48: warning: the comparison will always evaluate as ‘true’ for the address of ‘package_rank_ptr’ will never be NULL [-Waddress]
         } else if (PMIX_SUCCESS == (r) && NULL != (d)) {                               \
                                                ^
common_ofi.c:516:5: note: in expansion of macro ‘OPAL_MODEX_RECV_VALUE_OPTIONAL’
     OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_PACKAGE_RANK, &pname, &package_rank_ptr, PMIX_UINT16);
     ^
../../../../opal/mca/pmix/pmix-internal.h:304:48: warning: the comparison will always evaluate as ‘true’ for the address of ‘locality_string’ will never be NULL [-Waddress]
         } else if (PMIX_SUCCESS == (r) && NULL != (d)) {                               \
                                                ^
common_ofi.c:536:9: note: in expansion of macro ‘OPAL_MODEX_RECV_VALUE_OPTIONAL’
         OPAL_MODEX_RECV_VALUE_OPTIONAL(rc, PMIX_LOCALITY_STRING, &pname, &locality_string,
         ^

@bwbarrett
Copy link
Member

On the first, I'll have to look at old Libfabric versions today; I thought FI_ENOSYS has always been defined, but maybe not. Ugh.

On the second, other than turning off that particular warning by default, I'm not sure what we can do. There are a couple warnings that are in modern -Wall that I'm dubious are useful.

@jsquyres jsquyres merged commit c1a4c08 into open-mpi:master Oct 1, 2021
@jsquyres jsquyres deleted the pr/ofi-compiler-warnings-fixup branch October 1, 2021 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants