On Wed, 10 Feb 2016 17:38:08 +0100
Jakub Jelinek <ja...@redhat.com> wrote:

> On Wed, Feb 10, 2016 at 05:27:46PM +0100, Tomáš Smetana wrote:
> > Hello,
> >   one of my packages (tvtime) failed to build during the mass rebuild.
> > Not a big deal, I think there are several ways to fix it. The odd thing
> > is that the build failed due to a rather unexpected change in C++
> > preprocessor (g++ -E or cpp).
> > 
> > Let's assume I have a test.cpp file containing this:
> > 
> > #define MYMACRO(a, b) ""a", "b""
> > MYMACRO(x,y)
> > 
> > Now `cpp test.cpp' (or `g++ -E test.cpp') on rawhide produces:  
> 
> That is expected, and in F23 you get the same behavior if you use
> -std=c++11 or -std=c++14.

Yup. This part is obvious... :)

> In C++11 and later the language has user defined literals, so if you just
> want to concatenate strings, you need to put a whitespace in between them,
> otherwise the preprocessor considers ""a as user defined literal, similarly
> for ", "b and that is why it is not macro expanded.
> Just use
> #define MYMACRO(a, b) "" a ", " b ""

OK. Thanks a lot for the explanation.

Regards,
-- 
Tomáš Smetana
Platform Engineering, Red Hat
--
devel mailing list
devel@lists.fedoraproject.org
http://lists.fedoraproject.org/admin/lists/devel@lists.fedoraproject.org

Reply via email to