public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug nptl/28036] New: Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro
@ 2021-06-30 20:07 marc.c.dionne at gmail dot com
  2021-08-19 12:31 ` [Bug nptl/28036] " fweimer at redhat dot com
  2021-09-21  5:19 ` fweimer at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: marc.c.dionne at gmail dot com @ 2021-06-30 20:07 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28036

            Bug ID: 28036
           Summary: Incorrect types for pthread_mutexattr_set/getrobust_np
                    in __REDIRECT_NTH macro
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: nptl
          Assignee: unassigned at sourceware dot org
          Reporter: marc.c.dionne at gmail dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Created attachment 13519
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13519&action=edit
Proposed patch

Commits 9b7ab14e1124 ("nptl: Move pthread_mutexattr_getrobust into libc") and
1ec4cd5ab42d ("nptl: Move pthread_mutexattr_setrobust into libc") deprecated
pthread_mutexattr_getrobust_np and pthread_mutexattr_setrobust_np, and added
this into pthread.h (similar for getrobust):

#  ifdef __REDIRECT_NTH
extern int __REDIRECT_NTH (pthread_mutexattr_setrobust_np,
                           (pthread_mutex_t *, int),
                           pthread_mutexattr_setrobust) __nonnull ((1))
  __attribute_deprecated_msg__ ("\
pthread_mutexattr_setrobust_np is deprecated, use
pthread_mutexattr_setrobust");
#  else
#   define pthread_mutexattr_setrobust_np pthread_mutexattr_setrobust
#  endif

Note that the first prototype type in __REDIRECT_NTH is pthread_mutex_t *,
while the functions take a pthread_mutexattr_t *.  This results in an
additional warning (along with the deprecated function warning) while compiling
a source file that uses those functions:

warning: passing argument 1 of ‘pthread_mutexattr_setrobust_np’ from
incompatible pointer type [-Wincompatible-pointer-types]

/usr/include/pthread.h:949:12: note: expected ‘pthread_mutex_t *’ but argument
is of type ‘pthread_mutexattr_t *’

So I think that something like the attached patch is needed to get the correct
types.

Thanks,
Marc

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nptl/28036] Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro
  2021-06-30 20:07 [Bug nptl/28036] New: Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro marc.c.dionne at gmail dot com
@ 2021-08-19 12:31 ` fweimer at redhat dot com
  2021-09-21  5:19 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2021-08-19 12:31 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28036

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fweimer at redhat dot com
     Ever confirmed|0                           |1
           Assignee|unassigned at sourceware dot org   |fweimer at redhat dot com
   Last reconfirmed|                            |2021-08-19
             Status|UNCONFIRMED                 |ASSIGNED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug nptl/28036] Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro
  2021-06-30 20:07 [Bug nptl/28036] New: Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro marc.c.dionne at gmail dot com
  2021-08-19 12:31 ` [Bug nptl/28036] " fweimer at redhat dot com
@ 2021-09-21  5:19 ` fweimer at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: fweimer at redhat dot com @ 2021-09-21  5:19 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28036

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |2.35
         Resolution|---                         |FIXED

--- Comment #1 from Florian Weimer <fweimer at redhat dot com> ---
Fixed for 2.35 via (and backported to 2.34);

commit f3e664563361dc17530113b3205998d1f19dc4d9
Author: Florian Weimer <fweimer@redhat.com>
Date:   Tue Sep 21 07:12:56 2021 +0200

    nptl: Fix type of pthread_mutexattr_getrobust_np,
pthread_mutexattr_setrobust_np (bug 28036)

    Reviewed-by: Carlos O'Donell <carlos@redhat.com>
    Tested-by: Carlos O'Donell <carlos@redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2021-09-21  5:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-30 20:07 [Bug nptl/28036] New: Incorrect types for pthread_mutexattr_set/getrobust_np in __REDIRECT_NTH macro marc.c.dionne at gmail dot com
2021-08-19 12:31 ` [Bug nptl/28036] " fweimer at redhat dot com
2021-09-21  5:19 ` fweimer at redhat dot com

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).