This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/12153] New: use of keywords in macro definitions (e.g. void in assert) can make compilation fail


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]