Bug 48690 - DBUS headers are not compatible with C++11
Summary: DBUS headers are not compatible with C++11
Status: RESOLVED DUPLICATE of bug 46147
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.4.x
Hardware: All All
: medium normal
Assignee: Havoc Pennington
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-14 07:40 UTC by konrad
Modified: 2012-04-14 15:01 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.