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
4 changes: 2 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ AC_CONFIG_HEADERS([src/sst/core/sst_config.h])
# Lets check for the standard compilers and basic options
AC_PROG_CC
AM_PROG_CC_C_O
m4_if(m4_defn([AC_AUTOCONF_VERSION]), 2.71,, m4_defn([AC_AUTOCONF_VERSION]), 2.70,, [AC_PROG_CC_C99])
m4_if(m4_defn([AC_AUTOCONF_VERSION]), 2.71,, m4_defn([AC_AUTOCONF_VERSION]), 2.70,, [AC_PROG_CC_C99])
AC_C_INLINE
AC_PROG_MAKE_SET

Expand Down Expand Up @@ -62,7 +62,7 @@ esac

SST_CHECK_PICKY
AS_IF([test "x$use_picky" = "xyes"],
[WARNFLAGS="-Wall -Wextra"],
[WARNFLAGS="-Wall -Wextra -Wvla"],
[WARNFLAGS=""])
CFLAGS="$CFLAGS $WARNFLAGS"
CXXFLAGS="$CXXFLAGS $WARNFLAGS"
Expand Down
7 changes: 4 additions & 3 deletions src/sst/core/bootsst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#include "sst/core/configShared.h"

#include <cstdlib>
#include <string.h>
#include <cstring>
#include <memory>
#include <unistd.h> // for opterr

int
Expand All @@ -31,14 +32,14 @@ main(int argc, char* argv[])
SST::ConfigShared cfg(true, true, true, true);

// Make a copy of the argv array (shallow)
char* argv_copy[argc + 1];
auto argv_copy = std::make_unique<char*[]>(argc + 1);
for ( int i = 0; i < argc; ++i ) {
argv_copy[i] = argv[i];
}
argv[argc] = nullptr;

// All ranks parse the command line
cfg.parseCmdLine(argc, argv_copy);
cfg.parseCmdLine(argc, argv_copy.get());

if ( cfg.no_env_config() ) config_env = 0;
if ( cfg.verbose() ) verbose = 1;
Expand Down
7 changes: 5 additions & 2 deletions src/sst/core/bootsstinfo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#include "sst/core/bootshared.h"
#include "sst/core/configShared.h"

#include <cstdio>
#include <memory>

int
main(int argc, char* argv[])
{
Expand All @@ -26,13 +29,13 @@ main(int argc, char* argv[])
SST::ConfigShared cfg(true, true, true, true);

// Make a copy of the argv array (shallow)
char* argv_copy[argc + 1];
auto argv_copy = std::make_unique<char*[]>(argc + 1);
for ( int i = 0; i < argc; ++i ) {
argv_copy[i] = argv[i];
}
argv[argc] = nullptr;

cfg.parseCmdLine(argc, argv_copy, true);
cfg.parseCmdLine(argc, argv_copy.get(), true);

if ( cfg.no_env_config() ) config_env = false;

Expand Down
10 changes: 6 additions & 4 deletions src/sst/core/configBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <cstdlib>
#include <getopt.h>
#include <iostream>
#include <memory>
#include <string>
#include <sys/ioctl.h>
#include <sys/stat.h>
Expand Down Expand Up @@ -317,13 +318,13 @@ ConfigBase::parseCmdLine(int argc, char* argv[], bool ignore_unknown)
// Turn off printing of errors in getopt_long
opterr = 0;
}
struct option sst_long_options[num_options + 2];
auto sst_long_options = std::make_unique<option[]>(num_options + 2);

// Because a zero index can mean two different things, we put in a
// dummy so we don't ever get a zero index
sst_long_options[0] = { "*DUMMY_ARGUMENT*", no_argument, nullptr, 0 };
int option_map[num_options + 1];
option_map[0] = 0;
auto option_map = std::make_unique<int[]>(num_options + 1);
option_map[0] = 0;
{
int count = 1;

Expand Down Expand Up @@ -359,7 +360,8 @@ ConfigBase::parseCmdLine(int argc, char* argv[], bool ignore_unknown)
int status = 0;
while ( 0 == status ) {
int option_index = 0;
const int intC = getopt_long(my_argc, argv, short_options_string.c_str(), sst_long_options, &option_index);
const int intC =
getopt_long(my_argc, argv, short_options_string.c_str(), sst_long_options.get(), &option_index);

if ( intC == -1 ) /* We're done */
break;
Expand Down
7 changes: 4 additions & 3 deletions src/sst/core/impl/partitioners/simplepart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "sst/core/warnmacros.h"

#include <map>
#include <memory>
#include <stdlib.h>
#include <vector>

Expand Down Expand Up @@ -192,8 +193,8 @@ SimplePartitioner::performPartition(PartitionGraph* graph)
graph->getNumComponents() % 2 == 1 ? (graph->getNumComponents() / 2) + 1 : (graph->getNumComponents() / 2);
const int B_size = graph->getNumComponents() / 2;

ComponentId_t setA[A_size];
ComponentId_t setB[B_size];
auto setA = std::make_unique<ComponentId_t[]>(A_size);
auto setB = std::make_unique<ComponentId_t[]>(B_size);

int indexA = 0;
int indexB = 0;
Expand Down Expand Up @@ -229,7 +230,7 @@ SimplePartitioner::performPartition(PartitionGraph* graph)
}
}

simple_partition_step(component_map, setA, A_size, 0, setB, B_size, 1, timeTable, 1);
simple_partition_step(component_map, setA.get(), A_size, 0, setB.get(), B_size, 1, timeTable, 1);
}
}

Expand Down
Loading