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/2471] New: limited functionality of macro __CONCAT()


Hi,

current definition of  macro __CONCAT() is limited, it does not allow to pass
__CONCAT()
as direct argument of __CONCAT(). The behaviour can be  shown by "gcc -E in.c" on

#define __CONCAT1(x,y)   x ## y
#define __CONCATN(x,y)   __CONCAT1(x,y)

__CONCAT1(First,__CONCAT1(Second,Third))
__CONCATN(First,__CONCATN(Second,Third))

Result of first test is First__CONCAT1(Second,Third), which is correct
behaviour of preprocessor , because "if an argument is stringified or
concatenated, the prescan does not occur".

But intuitively expected behaviour of __CONCAT()  would be same as result of
second test - FirstSecondThird.

Please, could you allow chaining of __CONCAT() via atached patch ?

Thanks

Petr

-- 
           Summary: limited functionality of macro __CONCAT()
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: Petr dot Salinger at seznam dot cz
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=2471

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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