libqrencode icon indicating copy to clipboard operation
libqrencode copied to clipboard

Will libqrencode support arm64 ?

Open cuichunjian opened this issue 10 years ago • 5 comments

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?

cuichunjian avatar Nov 18 '14 07:11 cuichunjian

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.

fukuchi avatar Nov 18 '14 08:11 fukuchi

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.

billykan avatar Nov 24 '14 04:11 billykan

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 avatar Nov 24 '14 10:11 billykan

@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.

ArtSabintsev avatar Dec 04 '14 05:12 ArtSabintsev

Thank you @billykan and @ArtSabintsev for your reports. I'll fix this issue in the development branch.

fukuchi avatar Dec 07 '14 05:12 fukuchi