Skip to content

Commit

Permalink
Fixing compiler warnings from nvhpc on Polaris
Browse files Browse the repository at this point in the history
  • Loading branch information
khuck committed Jul 11, 2023
1 parent c6531c8 commit 1c60469
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion src/apex/apex_ompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1412,12 +1412,14 @@ extern "C" void apex_ompt_work (
static const char * taskloop_str = "Taskloop";
static const char * unknown_str = "Unknown";

/*
static const char * iterations_type = "Iterations";
static const char * collapsed_type = "Iterations (collapsed)";
static const char * sections_type = "Sections";
static const char * units_type = "Units of Work";
static const char * single_type = "Single";
//char * count_type = const_cast<char*>(iterations_type);
char * count_type = const_cast<char*>(iterations_type);
*/

switch(wstype) {
case ompt_work_loop:
Expand Down
16 changes: 12 additions & 4 deletions src/wrappers/memory_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,16 @@ get_system_function_handle(char const * name, T caller)
return handle;
}

// __THROW is defined by gcc extensions to allow C and C++
// compilers to build with the same headers. If it isn't
// defined, make sure we define it.

#ifndef __THROW
#define __THROW
#endif

extern "C"
void* malloc (size_t size) {
void* malloc (size_t size) __THROW {
static malloc_p _malloc = NULL;
static bool initializing = false;
static bool bootstrapped = false;
Expand All @@ -197,7 +205,7 @@ void* malloc (size_t size) {
}

extern "C"
void free (void* ptr) {
void free (void* ptr) __THROW {
static free_p _free = NULL;
static bool initializing = false;
static bool bootstrapped = false;
Expand Down Expand Up @@ -248,7 +256,7 @@ int puts (const char* s) {
}

extern "C"
void* calloc (size_t nmemb, size_t size) {
void* calloc (size_t nmemb, size_t size) __THROW {
static calloc_p _calloc = NULL;
static bool initializing = false;
static bool bootstrapped = false;
Expand All @@ -272,7 +280,7 @@ void* calloc (size_t nmemb, size_t size) {
}

extern "C"
void* realloc (void* ptr, size_t size) {
void* realloc (void* ptr, size_t size) __THROW {
static realloc_p _realloc = NULL;
static bool initializing = false;
static bool bootstrapped = false;
Expand Down

0 comments on commit 1c60469

Please sign in to comment.