-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bytes_to_str
with string
as encoding.
#67
Comments
The general answer is that this is caused by a mismatch between the KS compiler version and the KS C++ runtime library version. If you use a released "stable" compiler from https://github.com/kaitai-io/kaitai_struct_compiler/releases/tag/0.10, the generated C++ code is meant to operate with the Although the generated C++ code contains a compile-time check for the mismatch between the version of the compiler (KSC) used to generate it and the C++ runtime library (kaitai-io/kaitai_struct#110), currently it's only designed for the case when the runtime library is older than it should be, not when the runtime library is newer than the generated code. It seems that the original idea of the linked issue was to diagnose the opposite direction as well, but it hasn't been implemented yet - see kaitai-io/kaitai_struct#110 (comment):
|
To be honest (cc @GreyCat), I personally don't see the benefits of changing the type of parameter
But I don't know C++ well enough to appreciate that or to be able to see how it helps specifically - is One other "advantage" I can think of is that using Nevertheless, I think that breaking backwards compatibility caused by removing the |
0.11 will definitely include some changes that require an updated runtime - for example kaitai-io/kaitai_struct_cpp_stl_runtime#67 or the fact that (once the `serialization` branch is merged) the compiler will no longer insert `align_to_byte()` calls and will instead rely on the runtime libraries to do it: kaitai-io/kaitai_struct#1070 (comment)). Besides, we need to require something newer than 0.9 to fix the version check in Python: kaitai-io/kaitai_struct#804 (comment)
I’ve just been bitten by the same issue. There’s a few things here to consider:
|
100%. I also don't understand why @GreyCat made a 0.10.1 version with a breaking change compared to 0.10 (https://github.com/kaitai-io/kaitai_struct_cpp_stl_runtime/compare/0.10..0.10.1#diff-b9569f864c19a6430234c5a161d3ab9e4f921daaae356d4a97dc1e458eef16f6) - I think it was a mistake. Now, it's indeed unclear with which version of KSC the 0.10.1 runtime library should be used.
Yeah, as I already mentioned above - #67 (comment), the existing version check only works in one direction, and in this case the problem is in the other direction, which is unchecked. |
It would appear that the Kaitait compiler generates calls to
bytes_to_str
, where the encoding parameter isstd::string
instead ofchar *
, so I had to add a wrapper function to make things build:The text was updated successfully, but these errors were encountered: