API/ABI break in git master: QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement

Aleksander Morgado aleksander at aleksander.es
Fri Dec 12 00:55:04 PST 2014


Hey,

"NAS Get Cell Location Info" responses were triggering errors when
parsing; but not due to a mismatched message format. Instead, the bug
was in the code generator, which wasn't treating properly fixed-size
strings in publicly exposed structs.

The following commit fixes the issue:
http://cgit.freedesktop.org/libqmi/commit/?id=b9c3701e3371984736240d2dded70c2d52f3b46e

But it also breaks ABI and (kind-of) API. The break is only in the
QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement type, where
the "plmn" element ends up changing from:
            gchar * plmn;
To:
            gchar plmn[4];

The break could be avoided by preallocating the 4 byte array, but it
really makes the generator codebase much more complex, and the
original intention was to expose the fixed size array also in the API,
so I think it's worth the break.

I say it's "kind-of" an API break because applications may have
already been treating this struct field as a string, and that didn't
really change as it's still a valid C string but fixed size instead.
E.g. qmicli was using this struct field and didn't need any
modification, just recompilation.

-- 
Aleksander
https://aleksander.es


More information about the libqmi-devel mailing list