This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
preprocessor/5240: Unicode L## doesn't work in all cases for macros
- From: dstarr at opera dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 2 Jan 2002 08:54:08 -0000
- Subject: preprocessor/5240: Unicode L## doesn't work in all cases for macros
- Reply-to: dstarr at opera dot com
>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: