API/ABI break in git master: QmiMessageNasGetCellLocationInfoOutputGeranInfoCellElement
Aleksander Morgado
aleksander at aleksander.es
Sun Jan 11 12:26:21 PST 2015
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.
>
I wasn't very happy with this API break; I just commited a change to
git master which should recover the old API and fix the internals. So
no API break will happen in the next stable release.
http://cgit.freedesktop.org/libqmi/commit/?id=010286ba2b513a0d279cf2e08aa68987eca7ed23
--
Aleksander
https://aleksander.es
More information about the libqmi-devel
mailing list