[Lazarus] LongString does not work?

Sven Barth pascaldragon at googlemail.com
Mon Mar 4 22:03:32 CET 2013


Am 04.03.2013 17:10, schrieb Luca Olivetti:
> Al 03/03/13 21:52, En/na Sven Barth ha escrit:
>> On 03.03.2013 20:32, Luca Olivetti wrote:
>>> Al 03/03/13 14:34, En/na Sven Barth ha escrit:
>>>
>>>> For "packed" there is the
>>>> guarantee though that the layout will stay the same.
>>> Are you sure? Does the same guarantee apply to bitpacked?
>>> Lately I've become lazy, and instead of manually decoding data (bits,
>>> bytes, words) read from a device, I'm relying on packed/bitpacked
>>> records, but I wasn't sure that upgrading the compiler wouldn't break my
>>> code.
>> For "packed" it is guaranteed (*), because this is the whole purpose of
>> this modifier, for "bitpacked" it is not. It just tells the compiler to
>> pack the record as densly as possible, but depending on the platform
>> this might not be possible.
> At the moment I don't care about the platform, only about different
> (newer) versions of the compiler.
> Currently , with 2.6.0, bitpacked under win32 gives me the correct
> layout (I have to adjust endianness for words/dwords but individual bit
> fields are where they should be).
> Can I be sure that 2.6.2 (and later version) won't break my code?
I can only give you a guarantee for packed. For bitpacked it's 
documented that you shouldn't rely on the binary format.

Regards,
Sven




More information about the Lazarus mailing list