diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-09-13 18:14:02 +0000 |
---|---|---|
committer | Tobias Burnus <tobias@codesourcery.com> | 2019-09-13 18:14:02 +0000 |
commit | 9e893cc9f5acea772164ca485c021911661ce434 (patch) | |
tree | 243c208259f87213a1985338bdcbb73e7e5e8b67 /libgomp | |
parent | 25af05945a1db67aabc66e90a664fb7888681d14 (diff) |
libgomp plugin - init string
libgomp/
2019-09-13 Tobias Burnus <tobias@codesourcery.com>
* plugin/plugin-hsa.c (hsa_warn, hsa_fatal, hsa_error): Ensure
string is initialized.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@275703 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/plugin/plugin-hsa.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index d1e4dc35c4a..a0fbf041e28 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-09-13 Tobias Burnus <tobias@codesourcery.com> + + * plugin/plugin-hsa.c (hsa_warn, hsa_fatal, hsa_error): Ensure + string is initialized. + 2019-09-06 Florian Weimer <fweimer@redhat.com> * configure: Regenerate. diff --git a/libgomp/plugin/plugin-hsa.c b/libgomp/plugin/plugin-hsa.c index 80f23f9beb6..c0837d04e5d 100644 --- a/libgomp/plugin/plugin-hsa.c +++ b/libgomp/plugin/plugin-hsa.c @@ -289,7 +289,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, "HSA warning: %s\nRuntime message: %s", str, hsa_error_msg); @@ -301,7 +301,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 ("HSA fatal error: %s\nRuntime message: %s", str, hsa_error_msg); @@ -313,7 +313,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 ("HSA fatal error: %s\nRuntime message: %s", str, hsa_error_msg); |