1
0
mirror of https://github.com/TREX-CoE/qmckl.git synced 2024-11-19 12:32:40 +01:00

Remove annoying warning in debug

This commit is contained in:
Anthony Scemama 2021-10-14 18:53:31 +02:00
parent 7ea06ffcce
commit acb034e88b

View File

@ -456,8 +456,19 @@ qmckl_get_error(qmckl_context context,
qmckl_context_struct* const ctx = (qmckl_context_struct* const) context;
assert (ctx != NULL); /* Impossible because the context is valid. */
/* Turn off annoying GCC warning */
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
strncpy(function_name, ctx->error.function, QMCKL_MAX_FUN_LEN-1);
strncpy(message , ctx->error.message , QMCKL_MAX_MSG_LEN-1);
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
(*exit_code) = ctx->error.exit_code;
}
qmckl_unlock(context);