Giter Club home page Giter Club logo

Comments (5)

 avatar commented on August 10, 2024

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.

kroggen avatar kroggen commented on August 10, 2024

Hi!

I am without spare time now, with lots of work.

Do you want to send a pull request?

from binn.

 avatar commented on August 10, 2024

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.

kroggen avatar kroggen commented on August 10, 2024

Yes.

Your pull request was merged.

Thank you for your contribution!

from binn.

 avatar commented on August 10, 2024

Good. Happy to help!

from binn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.