Bug 34529

Summary: dbus-specification should reserve the extra characters used in GVariant signatures
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Rob Taylor <rob.taylor>
Severity: enhancement    
Priority: medium CC: desrt, walters, zeuthen
Version: 1.5Keywords: patch
Hardware: Other   
OS: All   
Whiteboard: review+
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 36164    
Attachments: Reserve 'm', '*', '?', '@', '&' and '^' for their uses in GVariant
Clarify that 'r' and 'e' cannot appear in signatures

Description Simon McVittie 2011-02-21 04:32:25 UTC
GVariant uses D-Bus signatures plus extensions, without adding those extensions to dbus-specification. If we use those characters for anything in D-Bus, we'll become incompatible.

We should have something like:

    'm'    reserved for a 'maybe' type compatible with GVariant (Bug #27857),
           must not appear in signatures used on D-Bus until specified here

    '*'    reserved for bindings/implementations to represent any single
           complete type, must not appear in signatures used on D-Bus

    '?'    reserved for bindings/implementations to represent any basic type,
           must not appear in signatures used on D-Bus

    '@'    reserved for internal use in bindings/implementations,
           must not appear in signatures used on D-Bus

    '&'    reserved for internal use in bindings/implementations,
           must not appear in signatures used on D-Bus

    '^'    reserved for internal use in bindings/implementations,
           must not appear in signatures used on D-Bus

We could also consider something like this:

* reserve [a-zA-Z] for future type mnemonics
* reserve <>, [], "", '' for future bracket-like constructs
* reserve all other punctuation for internal use in bindings/implementations
Comment 1 Simon McVittie 2011-04-26 09:20:48 UTC
Created attachment 46092 [details] [review]
Reserve 'm', '*', '?', '@', '&' and '^' for their uses in GVariant
Comment 2 Simon McVittie 2011-04-26 09:22:44 UTC
Created attachment 46093 [details] [review]
Clarify that 'r' and 'e' cannot appear in signatures
Comment 3 Colin Walters 2011-04-26 11:40:42 UTC
In practice really everything not specified should be thought of as reserved; the bus daemon at least will just reject anything that it doesn't know about.

It's definitely useful to cross-link to GVariant, so these seem fine to me, but I don't think spelling out the rest of ASCII is necessary.
Comment 4 Simon McVittie 2011-04-27 10:05:59 UTC
Fixed in git for spec 0.17 (dbus 1.5.2)

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.