Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/sst/core/baseComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
else {
fatal(__LINE__, __FILE__, "createStatistic", 1, "failed to cast created statistic '%s' to expected type",
name.c_str());
return nullptr; // avoid compiler warnings
}
}

Expand Down Expand Up @@ -531,7 +530,6 @@ class BaseComponent : public SST::Core::Serialization::serializable_base
// not a valid stat and I won't be able to share my parent's statistic
fatal(__LINE__, __FILE__, "registerStatistic", 1, "attempting to register unknown statistic '%s'",
statName.c_str());
return nullptr; // get rid of warning
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/sst/core/event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ Event::execute()
(*reinterpret_cast<HandlerBase*>(delivery_info))(this);
}

DISABLE_WARN_MISSING_NORETURN
Event*
Event::clone()
{
Simulation_impl::getSimulation()->getSimulationOutput().fatal(CALL_INFO, 1,
"Called clone() on an Event that doesn't"
" implement it.");
return nullptr; // Never reached, but gets rid of compiler warning
}
REENABLE_WARNING

Event::id_type
Event::generateUniqueId()
Expand Down
2 changes: 0 additions & 2 deletions src/sst/core/factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,6 @@ Factory::GetValidStatistics(const std::string& compType)
// If we get to here, element doesn't exist
out.fatal(CALL_INFO, 1, "can't find requested component/subcomponent '%s'\n%s\n", compType.c_str(),
error_os.str().c_str());
static std::vector<std::string> null_return;
return null_return; // to avoid compiler warnings
}

bool
Expand Down
27 changes: 6 additions & 21 deletions src/sst/core/output.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define SST_CORE_OUTPUT_H

#include "sst/core/serialization/serializer_fwd.h"
#include "sst/core/warnmacros.h"

#include <string>
#include <vector>
Expand Down Expand Up @@ -299,8 +300,9 @@ class Output
@param format Format string. All valid formats for printf are available.
@param ... Arguments for format.
*/
void debugPrefix(const char* tempPrefix, uint32_t line, const char* file, const char* func, uint32_t output_level,
uint32_t output_bits, const char* format, ...) __attribute__((format(printf, 8, 9)))
void debugPrefix(const char* UNUSED(tempPrefix), uint32_t UNUSED(line), const char* UNUSED(file),
const char* UNUSED(func), uint32_t UNUSED(output_level), uint32_t UNUSED(output_bits),
const char* UNUSED(format), ...) __attribute__((format(printf, 8, 9)))
{

#ifdef __SST_DEBUG_OUTPUT__
Expand All @@ -321,15 +323,6 @@ class Output

m_outputPrefix = normalPrefix;
}
#else
/* When debug is disabled, silence warnings of unused parameters */
(void)tempPrefix;
(void)line;
(void)file;
(void)func;
(void)output_level;
(void)output_bits;
(void)format;
#endif
}

Expand All @@ -352,8 +345,8 @@ class Output
@param format Format string. All valid formats for printf are available.
@param ... Arguments for format.
*/
void debug(uint32_t line, const char* file, const char* func, uint32_t output_level, uint32_t output_bits,
const char* format, ...) const __attribute__((format(printf, 7, 8)))
void debug(uint32_t UNUSED(line), const char* UNUSED(file), const char* UNUSED(func), uint32_t UNUSED(output_level),
uint32_t UNUSED(output_bits), const char* UNUSED(format), ...) const __attribute__((format(printf, 7, 8)))
{
#ifdef __SST_DEBUG_OUTPUT__
va_list arg;
Expand All @@ -367,14 +360,6 @@ class Output
va_end(arg);
}
}
#else
/* When debug is disabled, silence warnings of unused parameters */
(void)line;
(void)file;
(void)func;
(void)output_level;
(void)output_bits;
(void)format;
#endif
}

Expand Down
7 changes: 2 additions & 5 deletions src/sst/core/simulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2159,14 +2159,11 @@ SST_Exit(int exit_code)

#ifdef SST_CONFIG_HAVE_MPI
// If MPI exists, abort
static int exit_once = (MPI_Abort(MPI_COMM_WORLD, exit_code), 0);
static int UNUSED(exit_once) = (MPI_Abort(MPI_COMM_WORLD, exit_code), 0);
#else
static int exit_once = (exit(exit_code), 0);
static int UNUSED(exit_once) = (exit(exit_code), 0);
#endif

// Should never get here, but need to use exit_once to avoid
// compiler warning
printf("exit_once = %d\n", exit_once);
std::terminate();
}

Expand Down
2 changes: 2 additions & 0 deletions src/sst/core/sstpart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace SST::Partition {
SST_ELI_DEFINE_INFO_EXTERN(SSTPartitioner)
SST_ELI_DEFINE_CTOR_EXTERN(SSTPartitioner)

DISABLE_WARN_MISSING_NORETURN
void
SSTPartitioner::performPartition(PartitionGraph* UNUSED(graph))
{
Expand All @@ -33,5 +34,6 @@ SSTPartitioner::performPartition(ConfigGraph* UNUSED(graph))
Output& output = Output::getDefaultObject();
output.fatal(CALL_INFO, 1, "ERROR: chosen partitioner does not support ConfigGraph");
}
REENABLE_WARNING

} // namespace SST::Partition
2 changes: 2 additions & 0 deletions src/sst/core/statapi/statbase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ StatisticBase::getCompName() const
return component_->getName();
}

DISABLE_WARN_MISSING_NORETURN
void
Statistic<void>::outputStatisticFields(StatisticFieldsOutput* UNUSED(stat_output), bool UNUSED(end_of_sim_flag))
{
Expand All @@ -129,6 +130,7 @@ Statistic<void>::registerOutputFields(StatisticFieldsOutput* UNUSED(stat_output)
"void statistic %s, type %s for component %s does not support outputing fields", getStatTypeName().c_str(),
getFullStatName().c_str(), getComponent()->getName().c_str());
}
REENABLE_WARNING

void
StatisticBase::incrementCollectionCount(uint64_t increment)
Expand Down
2 changes: 2 additions & 0 deletions src/sst/core/statapi/statoutput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ StatisticFieldsOutput::getRegisteredField(fieldHandle_t fieldHandle)
return nullptr;
}

DISABLE_WARN_MISSING_NORETURN
void
StatisticFieldsOutput::outputField(fieldHandle_t UNUSED(fieldHandle), double UNUSED(data))
{
Expand Down Expand Up @@ -187,6 +188,7 @@ StatisticFieldsOutput::outputField(fieldHandle_t UNUSED(fieldHandle), uint64_t U
Simulation_impl::getSimulationOutput().fatal(
CALL_INFO, 1, "StatisticOutput %s does not support uint64_t output", getStatisticOutputName().c_str());
}
REENABLE_WARNING

void
StatisticFieldsOutput::output(StatisticBase* statistic, bool endOfSimFlag)
Expand Down
2 changes: 2 additions & 0 deletions src/sst/core/uninitializedQueue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ UninitializedQueue::UninitializedQueue(const std::string& message) :
message(message)
{}

DISABLE_WARN_MISSING_NORETURN
bool
UninitializedQueue::empty()
{
Expand Down Expand Up @@ -58,5 +59,6 @@ UninitializedQueue::front()
std::cout << message << std::endl;
abort();
}
REENABLE_WARNING

} // namespace SST
5 changes: 5 additions & 0 deletions src/sst/core/warnmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@

#define DISABLE_WARN_DANGLING_POINTER DIAG_PRAGMA(DIAG_COMPILER, push)

#define DISABLE_WARN_MISSING_NORETURN DIAG_PRAGMA(DIAG_COMPILER, push)

#elif defined(__GNUC__)

#define DIAG_COMPILER GCC
Expand All @@ -62,6 +64,8 @@

#define DISABLE_WARN_STRICT_ALIASING DIAG_DISABLE(strict-aliasing)

#define DISABLE_WARN_MISSING_NORETURN DIAG_DISABLE(missing-noreturn)

#if ( __GNUC__ >= 5 )
#define DISABLE_WARN_MISSING_OVERRIDE DIAG_DISABLE(suggest-override)
#else
Expand Down Expand Up @@ -89,6 +93,7 @@
#define DISABLE_WARN_MISSING_OVERRIDE
#define DISABLE_WARN_CAST_FUNCTION_TYPE
#define DISABLE_WARN_DANGLING_POINTER
#define DISABLE_WARN_MISSING_NORETURN

#endif

Expand Down
Loading