From acb034e88bdfc53c5891e87d082893f9fd213f6b Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Thu, 14 Oct 2021 18:53:31 +0200 Subject: [PATCH] Remove annoying warning in debug --- org/qmckl_error.org | 11 +++++++++++ 1 file changed, 11 insertions(+) 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);