diff --git a/org/qmckl_error.org b/org/qmckl_error.org index 0849de2..cecd42d 100644 --- a/org/qmckl_error.org +++ b/org/qmckl_error.org @@ -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);