This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

preprocessor/5240: Unicode L## doesn't work in all cases for macros



>Number:         5240
>Category:       preprocessor
>Synopsis:       Unicode L## doesn't work in all cases for macros
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 02 00:56:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     dstarr@opera.com
>Release:        versions 3.0 and later
>Organization:
>Environment:
All
>Description:
This is best described by first looking at the code.
When using the code which is listed in the How-To-Repeat section, a compiler error occurs stating that LMyTestString was not declared.
This to me makes it seam that the preprocessor is expanding UNI_L(MyTestString) to LMyTestString instead of L##MyTestString.
I'm not 100% sure that this is perfectly valid code, however MSVC, CodeWarrior, Intel (list goes on a long while) all handle this code as intended.
>How-To-Repeat:
#define UNI_L(string) L##string
#define MyTestString "Hello World!"

int main(int argc, char **argv)
{
...
    CallToUnicodeFunction(UNI_L(MyTestString));
...
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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