Illegal exception when when assigning a value to a double c++ linux x86-64

51 views Asked by At

When running this simple program I get an Illegal instruction error

struct params{
    double resf{};
};

int foo(params& params)
{
    params.resf = 0.05;
}

int main()
{
    params params;
    foo(params);
}

EDIT: changing the return type from int to void causes everything to work, despite the wrong return type seeming to be unrelated

0

There are 0 answers