This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/9868] New: use of do; while(0) in pthread.h makes gcc barf
- From: "madcoder at debian dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 19 Feb 2009 12:06:06 -0000
- Subject: [Bug nptl/9868] New: use of do; while(0) in pthread.h makes gcc barf
- Reply-to: sourceware-bugzilla at sourceware dot org
When using strict compiling flags, (-Wempty-body that is) the use of
pthread_cleanup_pop generates warnings like:
mcms/mcms-if-file.c:534: error: suggest braces around empty body in 'do'
statement [-Wempty-body]
This is because of the use of `do; while(0)`.
Please use `(void)0;` or `do { } while(0)` instead which won't trigger the same
warning and still allow to place a label before pthread_cleanup_pop which is
what the `do; while(0)` tries to achieve.
--
Summary: use of do; while(0) in pthread.h makes gcc barf
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: drepper at redhat dot com
ReportedBy: madcoder at debian dot org
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=9868
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.