You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assuming the C interface of MINPACK is used in C++ program, should the callback types also have C linkage specified?
extern"C" { // <-- do we need this?typedefvoid (*minpack_func)(
int/* n */,
constdouble* /* x */,
double* /* fvec */,
int* /* iflag */,
void* /* udata */);
} // <-- do we need this?
The last section of this Oracle document, Pointers to Functions as Function Parameters, appears to say that unless the linkage is specified, the following declaration
MINPACK_EXTERN void MINPACK_CALL
minpack_hybrd(
minpack_func /* fcn */,
int/* n */,
double* /* x */,
double* /* fvec */,
...);
assumes the fcn argument will have C++ linkage and not C, like expected by the Fortran interfaces (definitions).
Typically, C and C++ compilers of the same vendor will be binary compatible when it comes to function linkage, but in principle they don't have to be.
The text was updated successfully, but these errors were encountered:
We have that in MINPACK_EXTERN macro for the procedures, but not for the callback typedefs. According to the Oracle resources, the typedefs should have it too.
Assuming the C interface of MINPACK is used in C++ program, should the callback types also have C linkage specified?
The last section of this Oracle document, Pointers to Functions as Function Parameters, appears to say that unless the linkage is specified, the following declaration
assumes the
fcn
argument will have C++ linkage and not C, like expected by the Fortran interfaces (definitions).Typically, C and C++ compilers of the same vendor will be binary compatible when it comes to function linkage, but in principle they don't have to be.
The text was updated successfully, but these errors were encountered: