diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index e52297e2c4..08f61902b8 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -217,8 +217,11 @@ bool Foam::functionEntries::codeStream::execute // Find the library handle. - void (*function)(const dictionary&, Ostream& os); - *(void **) (&function) = dlSym(lib, name); + void (*function)(const dictionary&, Ostream&); + function = reinterpret_cast + ( + dlSym(lib, name) + ); if (!function) {