aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2019-09-12 18:07:53 +0200
committerThomas Schwinge <thomas@codesourcery.com>2020-03-03 12:51:25 +0100
commit2e2b9bc5300652abf7a1968e08c9b4c2ed1b7e6c (patch)
treeb60f1532c1ec40e549e46c619f8f5c46cc3178dd
parentd6279083f9e03f7c601e7aac7c399ea5cb70b9d5 (diff)
downloadgcc-2e2b9bc5300652abf7a1968e08c9b4c2ed1b7e6c.zip
gcc-2e2b9bc5300652abf7a1968e08c9b4c2ed1b7e6c.tar.gz
gcc-2e2b9bc5300652abf7a1968e08c9b4c2ed1b7e6c.tar.bz2
libgomp plugin-gcn - init string
libgomp/ 2019-09-13 Tobias Burnus <tobias@codesourcery.com> * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure string is initialized. (cherry picked from openacc-gcc-9-branch commit 392044a8db285d9aea0a280983ce7c5014a4e99c)
-rw-r--r--libgomp/ChangeLog.omp5
-rw-r--r--libgomp/plugin/plugin-gcn.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/libgomp/ChangeLog.omp b/libgomp/ChangeLog.omp
index 355e406..14ed4e0 100644
--- a/libgomp/ChangeLog.omp
+++ b/libgomp/ChangeLog.omp
@@ -1,3 +1,8 @@
+2019-09-13 Tobias Burnus <tobias@codesourcery.com>
+
+ * plugin/plugin-gcn.c (hsa_warn, hsa_fatal, hsa_error): Ensure
+ string is initialized.
+
2019-09-10 Julian Brown <julian@codesourcery.com>
* plugin/plugin-gcn.c (GOMP_hsa_kernel_dispatch): Remove
diff --git a/libgomp/plugin/plugin-gcn.c b/libgomp/plugin/plugin-gcn.c
index f7e3554..b8ec963 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);