libqrencode
libqrencode copied to clipboard
Will libqrencode support arm64 ?
you know, apple will reject any app that doesn't support arm64 before next Feb. That means all third-party frameworks in my project need support arm64. libqrencode is a good framework, so will it support arm64 proccessor?
While I want to support arm64 platform, I have no machines to test it. I'd like to ask you to test the latest libqrencode on arm64 and let us know if you found any issues.
I have tried to compile libqrencode on arm64 and got two compilation warnings "Implicit conversion loses integer precision 'unsigned long' to int". They are from qrencode.c under the functions QRcode_encodeString8bit and QRcode_encodeString8bitStructured. In both cases, the problematic code is:
ret = QRinput_append(input, QR_MODE_8, strlen(string), (unsigned char *)string);
The problem is strlen() is returning "unsigned long" under arm64 and QRinput_append accepts "int" instead, causing a truncation of value.
Hope it helps.
The other issues are in split.c where there were many pointer arithmetics and the results are stored in int - again truncation would occur when as pointers are changed to 8 bytes in arm64
@billykan if you know ahead of time that you're dealign with small values, you can silence that warning by typecasting to uint32_t:
ret = QRinput_append(input, QR_MODE_8, (uint32_t)strlen(string), (unsigned char *)string);
I feel your pain though.
Thank you @billykan and @ArtSabintsev for your reports. I'll fix this issue in the development branch.