Comments (1)
You should have stated which compiler version you are using; it would help me understand why you are getting these warning messages. From the provided text, it looks like you are using Visual C++ on Windows in the first block, and GCC on Linux in the second block. Your line numbers (e.g. BitBuffer.cpp:39, QrCode.cpp:696) are different from my reference copy. I had to use the quoted text to find the code in question. Please try to be more helpful in future bug reports, not just to me, but to anyone.
I fixed your first set of warnings in 908dbbf . I did some testing of the logic a few months ago, and found that GCC and Clang/LLVM are smart enough to understand that the 0th iteration of the loop will necessarily overwrite colorX, runX, etc. Thus it is mathematically impossible to have an uninitialized read of the variables. If I change the condition to x == 1
, then GCC and LLVM correctly figure out that the variable may (will) be uninitialized before reading. I believe Visual C++ is not smart enough to figure this out, so it always gives the warning.
For the second set of warnings, I have never seen them in any compiler I used. My overall verdict is will-not-fix, because the warnings are overly pedantic (which I have not even seen using -Wpedantic
on my compilers!), and the fix would make the code ugly. The crux of the three conversion warnings is the interplay between uint_8
(unsigned char
) and int
(int16_t
or wider).
- The first warning ("BitBuffer.cpp:39") basically concerns: uint8_t |= (bool ? int : int);. However, the right side value always fits in a uint8_t.
- The second and third warnings ("QrCode.cpp:696,713") basically concern: uin8_t ^= uint8_t; The result always fits in a uint8_t. However, the expression expands to uint8_t = uint8_t ^ uint8_t, where the right side is promoted to int. This would mean I would need to write out uint8_t = static_cast<uint8_t>(uint8_t ^ uint8_t);, which only adds to the obfuscation.
from qr-code-generator.
Related Issues (20)
- Hafizullah 8
- New maven release HOT 1
- C++: Default constructor for QrCode or no-throw versions of the factory functions HOT 5
- Custom shapes support HOT 1
- `
- How can I generate urls HOT 2
- How to display a small logo in the middle HOT 2
- Support Shape HOT 1
- Support Embeded Logo Image HOT 2
- MicroQR support? HOT 1
- Alternative to toSvgString HOT 1
- Publish the `rust-no-heap` crate on crates.io HOT 2
- Option to insert an image/logo inside a QR image? HOT 2
- 🇫🇷Emmaus COM whattsapp
- Split data into multiple QR-codes using structured append mode HOT 5
- I would like to create a simple android app using your QR-Code-generator ... is it possible ? HOT 1
- UE5 Integration Hints HOT 1
- Letters get wrongly encoded as Kanji HOT 2
- Deno TypeScript Port HOT 1
- Optimize library footprint HOT 2
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 qr-code-generator.