From 2e2b9bc5300652abf7a1968e08c9b4c2ed1b7e6c Mon Sep 17 00:00:00 2001 From: Tobias Burnus Date: Thu, 12 Sep 2019 18:07:53 +0200 Subject: [PATCH] libgomp plugin-gcn - init string libgomp/ 2019-09-13 Tobias Burnus * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure string is initialized. (cherry picked from openacc-gcc-9-branch commit 392044a8db285d9aea0a280983ce7c5014a4e99c) --- libgomp/ChangeLog.omp | 5 +++++ libgomp/plugin/plugin-gcn.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp index 355e406d4e32..14ed4e0ec2c9 100644 --- a/libgomp/ChangeLog.omp +++ b/libgomp/ChangeLog.omp @@ -1,3 +1,8 @@ +2019-09-13 Tobias Burnus + + * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure + string is initialized. + 2019-09-10 Julian Brown * plugin/plugin-gcn.c (GOMP_hsa_kernel_dispatch): Remove diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c index f7e3554f2977..b8ec96391f7f 100644 --- a/libgomp/plugin/plugin-gcn.c +++ b/libgomp/plugin/plugin-gcn.c @@ -489,7 +489,7 @@ hsa_warn (const char *str, hsa_status_t status) if (!debug) return; - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); fprintf (stderr, "GCN warning: %s\nRuntime message: %s\n", str, @@ -502,7 +502,7 @@ hsa_warn (const char *str, hsa_status_t status) static void hsa_fatal (const char *str, hsa_status_t status) { - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); GOMP_PLUGIN_fatal ("GCN fatal error: %s\nRuntime message: %s\n", str, hsa_error_msg); @@ -514,7 +514,7 @@ hsa_fatal (const char *str, hsa_status_t status) static bool hsa_error (const char *str, hsa_status_t status) { - const char *hsa_error_msg; + const char *hsa_error_msg = "[unknown]"; hsa_fns.hsa_status_string_fn (status, &hsa_error_msg); GOMP_PLUGIN_error ("GCN fatal error: %s\nRuntime message: %s\n", str, hsa_error_msg); -- 2.47.2