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]

[Bug preprocessor/60492] New: Using the L#param in a macro fails


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60492

            Bug ID: 60492
           Summary: Using the L#param in a macro fails
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jr at heisey dot org

#define DEFINE_XML_TOKEN_STRING(n, s) const char n##a[] = #s; const wchar_t
n##w[] = L#s;

//defines for tags
DEFINE_XML_TOKEN_STRING(CONFIG_ELM, config)

The preprocessor inserts a space resulting in 
L "config"
rather than
L"config"

First saw this on gcc on Windows.
[D:\Proj\Synaptics\tools]"d:\Program Files
(x86)\CodeBlocks.13\MinGW\bin\gcc.exe
" --version
gcc.exe (tdm-2) 4.8.1
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reproduced it on GCC 4.5.1 on Fedora.
[jrheisey@usu-fury CDCIApi]$ g++ --version
g++ (GCC) 4.5.1 20100924 (Red Hat 4.5.1-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


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