public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] Fix android build.
@ 2015-02-18 10:59 Ilya Tocar
  2015-02-18 11:08 ` Jakub Jelinek
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Tocar @ 2015-02-18 10:59 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: GCC Patches

Hi,

On android dlerror returns const char*.
Ok for trunk?

libgomp/
	* target.c (gomp_load_plugin_for_device): Fix type of dlerror
	return value.
	(DLSYM_OPT): Ditto.
---
 libgomp/target.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libgomp/target.c b/libgomp/target.c
index 73e757a..50baa4d 100644
--- a/libgomp/target.c
+++ b/libgomp/target.c
@@ -919,7 +919,7 @@ static bool
 gomp_load_plugin_for_device (struct gomp_device_descr *device,
 			     const char *plugin_name)
 {
-  char *err = NULL, *last_missing = NULL;
+  const char *err = NULL, *last_missing = NULL;
   int optional_present, optional_total;
 
   /* Clear any existing error.  */
@@ -947,7 +947,7 @@ gomp_load_plugin_for_device (struct gomp_device_descr *device,
 #define DLSYM_OPT(f, n)						\
   do									\
     {									\
-      char *tmp_err;							\
+      const char *tmp_err;							\
       device->f##_func = dlsym (plugin_handle, "GOMP_OFFLOAD_" #n);	\
       tmp_err = dlerror ();						\
       if (tmp_err == NULL)						\
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] Fix android build.
  2015-02-18 10:59 [Patch] Fix android build Ilya Tocar
@ 2015-02-18 11:08 ` Jakub Jelinek
  0 siblings, 0 replies; 2+ messages in thread
From: Jakub Jelinek @ 2015-02-18 11:08 UTC (permalink / raw)
  To: Ilya Tocar; +Cc: GCC Patches

On Wed, Feb 18, 2015 at 01:59:25PM +0300, Ilya Tocar wrote:
> Hi,
> 
> On android dlerror returns const char*.

Looks like POSIX violation.

> Ok for trunk?
> 
> libgomp/
> 	* target.c (gomp_load_plugin_for_device): Fix type of dlerror
> 	return value.
> 	(DLSYM_OPT): Ditto.

Therefore, I wouldn't word the ChangeLog entry this way, because it
isn't fixing it, it is working around Android bug.
So what about
Use const char * instead of char * for variables holding dlerror return
values.
?  Ok with that change.

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-18 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-18 10:59 [Patch] Fix android build Ilya Tocar
2015-02-18 11:08 ` Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).