Bug 48690

Summary: DBUS headers are not compatible with C++11
Product: dbus Reporter: konrad
Component: coreAssignee: Havoc Pennington <hp>
Status: RESOLVED DUPLICATE QA Contact: John (J5) Palmieri <johnp>
Severity: normal    
Priority: medium    
Version: 1.4.x   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description konrad 2012-04-14 07:40:16 UTC
When compiling any sources that use dbus with GCC 4.7 the compilation fails with "unable to find string literal operator 'operator"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER'" and gives the warning "ISO C99 requires whitespace after the macro name".

Header: dbus-protocol.h

The line 428:
#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE"<!DOCTYPE node PUBLIC \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
should instead read thus:
#define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"

Please notice the added whitespace between macros and "literal strings" - since C++11 allows to define new literals with a very similar syntax the left out spaces make the source ambiguous.
Comment 1 Thiago Macieira 2012-04-14 15:01:30 UTC
Already fixed.

*** This bug has been marked as a duplicate of bug 46147 ***

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.