Skip to content

Commit

Permalink
Suppress GCC warning about casting a function to void*
Browse files Browse the repository at this point in the history
Suppress the -Wconditionally-supported GCC warning about "casting between
pointer-to-function and pointer-to-object is conditionally-supported".
This is required to be supported by POSIX, and used extensively by dlsym(3).
  • Loading branch information
fwyzard authored and psychocoderHPC committed Aug 1, 2024
1 parent ba169cd commit 9c86141
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/alpaka/core/ApiCudaRt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,14 @@ namespace alpaka
template<typename T>
static inline Error_t funcGetAttributes(FuncAttributes_t* attr, T* func)
{
# if BOOST_COMP_GNUC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconditionally-supported"
# endif
return ::cudaFuncGetAttributes(attr, reinterpret_cast<void const*>(func));
# if BOOST_COMP_GNUC
# pragma GCC diagnostic pop
# endif
}

static inline Error_t getDeviceCount(int* count)
Expand Down
7 changes: 7 additions & 0 deletions include/alpaka/core/ApiHipRt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ namespace alpaka
template<typename T>
static inline Error_t funcGetAttributes(FuncAttributes_t* attr, T* func)
{
# if BOOST_COMP_GNUC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wconditionally-supported"
# endif
return ::hipFuncGetAttributes(attr, reinterpret_cast<void const*>(func));
# if BOOST_COMP_GNUC
# pragma GCC diagnostic pop
# endif
}

static inline Error_t getDeviceCount(int* count)
Expand Down

0 comments on commit 9c86141

Please sign in to comment.