Comments (5)
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.
from libqrencode.
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.
from libqrencode.
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
from libqrencode.
@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.
from libqrencode.
Thank you @billykan and @ArtSabintsev for your reports. I'll fix this issue in the development branch.
from libqrencode.
Related Issues (20)
- rMQR Support
- ANSI and UTF8 types do not display properly on Windows HOT 2
- Please mention SVG output option in usage summary
- [Build Failed] Please consider updating autotool scripts.
- The library doesn't respect the encoding standard HOT 1
- Generation of lib and dll for windows
- Optimal text segmentation HOT 1
- Generate a QR code image with logo HOT 5
- Detect type of image from extension
- Setting --dpi has no effect on the PNG output HOT 2
- qrencode does not work with local linux vt/console
- Is it possible to use QRcode_encodeData() with command line tool (qrencode)?
- input string beginning with "-" parsed as option HOT 4
- How to add qrencode libraries in Qt creator?
- Cmake error HOT 1
- libqrencode on Perl and on Windows
- Questionable interpretation of mask scoring criterion number 3 (finder pattern) HOT 2
- IS THIS PROJECT DEAD?
- What is the maximum string length for QRcode_encodeStringStructured? HOT 1
- Wrong constant in QRinput_encodeModeECI
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libqrencode.