Patchwork Fix libgconv.c warning

login
register
mail settings
Submitter David Edelsohn
Date May 4, 2013, 4:27 p.m.
Message ID <CAGWvnykKtP54VqGpLCEu+j6=x0oArPFHXRSbC++Pc83xf=X_wg@mail.gmail.com>
Download mbox | patch
Permalink /patch/241471/
State New
Headers show

Comments

David Edelsohn - May 4, 2013, 4:27 p.m.
Compiling libgconv.c with gthr-single.h current generates warnings
because __GTHREAD_MUTEX_INIT_FUNCTION may be empty.  The following
patch avoids the warnings.

Bootstrapped on powerpc-ibm-aix7.1.0.0.

Okay for trunk?

Thanks, David

        * libgcov.c (__gcov_fork): Add ATTRIBUTE_UNUSED to __gcov_flush_mx.
        Wrap possibly empty GTHREAD_MUTEX_INIT_FUNCTION in braces.

Patch

Index: libgcov.c
===================================================================
--- libgcov.c   (revision 198587)
+++ libgcov.c   (working copy)
@@ -1184,11 +1184,14 @@ 
 __gcov_fork (void)
 {
   pid_t pid;
-  extern __gthread_mutex_t __gcov_flush_mx;
+  /* __GTHREAD_MUTEX_INIT_FUNCTION may be empty.  */
+  extern __gthread_mutex_t __gcov_flush_mx ATTRIBUTE_UNUSED;
   __gcov_flush ();
   pid = fork ();
   if (pid == 0)
-    __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx);
+    {
+      __GTHREAD_MUTEX_INIT_FUNCTION (&__gcov_flush_mx);
+    }
   return pid;
 }
 #endif