Comments (5)
Here is an update,
I tried this on gcc 5.4.0 and it only seems to occur with speed optimizations turned on e.g -O1/-O2/-O3.
I skimmed through binn.c and it probably won't hurt to initialize these variables to 0 (zero) to get rid of the compiler warnings.
Fix: Init vuint64 = 0; @ line 2157
Fix: Init vint64 = 0; @ line 2157
Fix: Init vint = 0; @ line 730
Fix: Init len = 0; @ line 1572
Fix: Init id = 0; @ line 1571
Fix: Init key = NULL; @ 1572
binn.c: In function ‘copy_int_value’:
binn.c:2213:21: warning: ‘vint64’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*(int *)pdest = (int) vint64;
^
binn.c:2229:30: warning: ‘vuint64’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*(unsigned int *)pdest = (unsigned int) vuint64;
^
binn.c: In function ‘AddValue’:
binn.c:778:6: warning: ‘vint’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (vint >= INT32_MIN) {
^
binn.c:730:10: note: ‘vint’ was declared here
int64 vint;
^
binn.c: In function ‘binn_read_pair’:
binn.c:1619:9: warning: ‘len’ may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(pkey, key, len);
^
binn.c:1615:21: warning: ‘id’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (pid) *pid = id;
src/binn.c: In function ‘binn_read_pair’:
src/binn.c:1619:9: warning: ‘key’ may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(pkey, key, len);
from binn.
Hi!
I am without spare time now, with lots of work.
Do you want to send a pull request?
from binn.
Ok. I am kind of new to git so please tell me if I am doing something wrong here. I have forked binn, updated binn.c, and made a pull request. Is this correct?
from binn.
Yes.
Your pull request was merged.
Thank you for your contribution!
from binn.
Good. Happy to help!
from binn.
Related Issues (20)
- Sending object to C# TCP server
- Send layers of struct over TCP, possible? HOT 1
- Using binn in C# possible? HOT 1
- aes.hpp superfluous - C++/C has standards support semantics not reflected here. HOT 1
- Specification and version HOT 3
- Missing magic number in specification HOT 4
- Nested objects HOT 1
- Qt Creator can't compile header file (just 1 function) HOT 2
- Setting length of buffer HOT 2
- build issue on mips32 (big endian) HOT 1
- binn_map_get_blob() fails if blob size is 1 byte HOT 1
- Blob size implementation always uses 4-byte block HOT 4
- Performance Benchmark HOT 2
- Iterate over binn obj example HOT 2
- All key names should be "const char*" instead of "char*" HOT 2
- Contador no working?? HOT 2
- Array serialization HOT 1
- unable to create dll in visual studio 2019
- How to properly load and read a binn object from a data buffer without too many allocations? HOT 3
- Donating my Rust implementation
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 binn.