From 3ae2f9966bfdedca0b092ea9dab441418c4ed28c Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 31 Oct 2022 16:12:02 -0400 Subject: [PATCH] work around warnings when compiling with C++ and gcc -pedantic --- examples/COUPLE/plugin/liblammpsplugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/COUPLE/plugin/liblammpsplugin.c b/examples/COUPLE/plugin/liblammpsplugin.c index 1350a16513..09912448d7 100644 --- a/examples/COUPLE/plugin/liblammpsplugin.c +++ b/examples/COUPLE/plugin/liblammpsplugin.c @@ -60,9 +60,9 @@ liblammpsplugin_t *liblammpsplugin_load(const char *lib) lmp->handle = handle; #ifdef _WIN32 -#define ADDSYM(symbol) lmp->symbol = (void *) GetProcAddress((HINSTANCE) handle, "lammps_" #symbol) +#define ADDSYM(symbol) *(void **) (&lmp->symbol) = (void *) GetProcAddress((HINSTANCE) handle, "lammps_" #symbol) #else -#define ADDSYM(symbol) lmp->symbol = dlsym(handle,"lammps_" #symbol) +#define ADDSYM(symbol) *(void **) (&lmp->symbol) = dlsym(handle,"lammps_" #symbol) #endif #if defined(LAMMPS_LIB_MPI)