[Bug libc/2471] New: limited functionality of macro __CONCAT()

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2471] New: limited functionality of macro __CONCAT()

fweimer at redhat dot com
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.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2471] limited functionality of macro __CONCAT()

fweimer at redhat dot com

------- Additional Comments From Petr dot Salinger at seznam dot cz  2006-03-20 21:55 -------
Created an attachment (id=934)
 --> (http://sourceware.org/bugzilla/attachment.cgi?id=934&action=view)
proposed patch


--


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.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/2471] limited functionality of macro __CONCAT()

fweimer at redhat dot com
In reply to this post by fweimer at redhat dot com

------- Additional Comments From drepper at redhat dot com  2006-04-01 19:16 -------
This macro is traditionally defined this way.  Any change can disrupt existing
code.  There will be no change.

--
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


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.