cellml / libcellml

Repository for libCellML development.
https://libcellml.org
Apache License 2.0
17 stars 21 forks source link

Malloc gives a type error when using g++ compiler. #1075

Closed FinbarArgus closed 1 year ago

FinbarArgus commented 1 year ago

The generator C profile generates this code

double * createStatesArray()
{
    return malloc(STATE_COUNT*sizeof(double));
}

Which gives a error message:

error: invalid conversion from ‘void’ to ‘double’ [-fpermissive]

when using g++ compiler. The following change fixes this.

double * createStatesArray()
{
    return (double *) malloc(STATE_COUNT*sizeof(double));
}