This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/21513] pthread_cleanup_push macro generates warning when -Wclobbered is set
- From: "pcarroll at codesourcery dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 27 Jun 2017 00:41:48 +0000
- Subject: [Bug nptl/21513] pthread_cleanup_push macro generates warning when -Wclobbered is set
- Auto-submitted: auto-generated
- References: <bug-21513-131@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=21513
--- Comment #7 from Paul Carroll <pcarroll at codesourcery dot com> ---
Created attachment 10223
--> https://sourceware.org/bugzilla/attachment.cgi?id=10223&action=edit
Proposed patch for avoiding the compiler warning
I am adding a possible patch, which makes the 2 variables volatile, so the
compiler no longer warns about them.
The patch also includes a test case, which is checking for whether the warning
is emitted or not.
I tested with glibc 2.25, both unpatched and patched, and it behaves as
expected.
The unpatched toolkit will get an error in the test case when the
pthread_cleanup_push() macro is used while the patched toolkit will not.
The test itself does nothing.
--
You are receiving this mail because:
You are on the CC list for the bug.