Skip to content

Undocumented Initialize Behavior #227

Description

@JoGei

etiss/include/etiss/ETISS.h

Lines 312 to 326 in 854394c

template <typename argvT, typename... lisT>
Initializer(int argc, argvT **argv, lisT... args_append)
{
// const and non const *argv[] are allowed. This assertion is
// easier than duplicing the constructor.
static_assert(std::is_same<const char, argvT>::value || std::is_same<char, argvT>::value,
"argv must be of type const char or char");
std::vector<std::string> args;
for (int i = 1; i < argc; i++)
{
args.push_back(std::string(argv[i]));
}
toList(args, args_append...);
initialize(args);
}

Arguments passed to etiss::Initializer(argc, argv) skip the first argument. I assume this was intended to filter out the argv[0], which usually is the executable. However, in case some user code passes arguments not directly from main(argc, argv), this results in possibly unexpected behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationquestionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions