This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12153] New: use of keywords in macro definitions (e.g. void in assert) can make compilation fail
- From: "vincent+libc at vinc17 dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 22 Oct 2010 12:58:56 +0000
- Subject: [Bug libc/12153] New: use of keywords in macro definitions (e.g. void in assert) can make compilation fail
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=12153
Summary: use of keywords in macro definitions (e.g. void in
assert) can make compilation fail
Product: glibc
Version: 2.11
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: vincent+libc@vinc17.org
While the following program is strictly conforming in C99, it cannot be
compiled due to the use of void in the assert() macro:
#include <assert.h>
int main (void)
{
#define void error
assert(1);
#undef void
return 0;
}
I get under Debian/unstable with glibc 2.11.2:
redef-void.c: In function 'main':
redef-void.c:6: error: 'error' undeclared (first use in this function)
redef-void.c:6: error: (Each undeclared identifier is reported only once
redef-void.c:6: error: for each function it appears in.)
Other macros may have a similar problem. I haven't checked.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.