Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

inline functions declared, but not defined #1

Closed
gary-funck opened this issue Jan 23, 2016 · 2 comments
Closed

inline functions declared, but not defined #1

gary-funck opened this issue Jan 23, 2016 · 2 comments

Comments

@gary-funck
Copy link

On cori, using the PrgEnv-gnu (GCC) compiler, an initial make yields the following warnings:

$ make fompi_win_rma.o
cc -O3 -DXPMEM -DNA -DNDEBUG -Impitypes/install/include -Ilibtopodisc -c fompi_win_rma.c
In file included from fompi.h:6:0,
from fompi_win_rma.c:11:
fompi_internal.h:562:12: warning: inline function 'xpmem_notif_pop' declared but never defined
inline int xpmem_notif_pop(int16_t *rank, int16_t *tag, foMPI_Win win);
^
In file included from fompi.h:6:0,
from fompi_win_rma.c:11:
fompi_internal.h:561:12: warning: inline function 'xpmem_notif_push_and_data' declared but never defined
inline int xpmem_notif_push_and_data(int source_rank, MPI_Aint target_offs
^
fompi_internal.h:560:12: warning: inline function 'xpmem_notif_push' declared but never defined
inline int xpmem_notif_push(int16_t rank, int16_t tag, int target_rank, in
^
fompi_internal.h:555:12: warning: inline function '_foMPI_DecodeID' declared but never defined
inline int _foMPI_DecodeID(uint16_t *rank, uint16_t *id_msg, uint32_t id_e
^
fompi_internal.h:544:12: warning: inline function '_foMPI_Comm_flush_all_internal' declared but never defined
inline int _foMPI_Comm_flush_all_internal(_foMPI_Comm communicator);
^
fompi_internal.h:541:12: warning: inline function '_foMPI_is_addr_in_seg' declared but never defined
inline int _foMPI_is_addr_in_seg(void * addr, fompi_seg_desc_t *seg);
^
fompi_internal.h:536:32: warning: inline function '_foMPI_Comm_get_ugni_data_descriptor' declared but never defined
inline gni_post_descriptor_t * _foMPI_Comm_get_ugni_data_descriptor(_foMPI

It turns out that some of these functions declared as inline appear in more than one *.c file, so are not immediate candidates for re-definition as static inline functions. Here is the list of those functions:

_foMPI_Comm_flush_all_internal
_foMPI_Comm_get_ugni_data_descriptor
_foMPI_is_addr_in_seg
sse_memcpy
xpmem_notif_pop
xpmem_notif_push
xpmem_notif_push_and_data

@gary-funck
Copy link
Author

As an experiment, I changed fompi_internal.h to declare the inlined functions as extern inline. The test program now links, however the warnings remain.

It seems that the best next course of action is to remove the inline declarations completely both in fompi_internal.h and the corresponding .c files.

@jeffhammond
Copy link
Member

Shouldn't these just go in a header as static inline?

The difficulty is that if the code is moved from each defining location in a *.c file and then defined as static inline in fompi_internal.h, the code may/may not compile due to dependencies on other functions/definitions.

There is already some code that defines and uses static inline functions.

I can add an RFE issue which stays open:

Bring back inline functions and declare them in fompi_internal.h as static inline.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants