Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issues experimented running valgrind #3

Open
rcarbone opened this issue Jul 11, 2016 · 0 comments
Open

issues experimented running valgrind #3

rcarbone opened this issue Jul 11, 2016 · 0 comments

Comments

@rcarbone
Copy link

Hi,
I am running this very simple test program (as part of a complete suite) under valgrind.

/* System headers */

include <stdio.h>

include <stdlib.h>

include <stdbool.h>

include <assert.h>

/* public header */

include "chash.h"

/* Basic allocate and free */
static void alloc_free (void)
{
CHASH_CONTEXT ht;
int ret = chash_initialize (& ht, true);
assert (ret == CHASH_ERROR_DONE);
ret = chash_terminate (& ht, true);
assert (ret == CHASH_ERROR_DONE);
}

int main (int argc, char * argv [])
{
alloc_free ();
return 0;
}

valgrind output is:
==24137== Conditional jump or move depends on uninitialised value(s)
==24137== at 0x4010AD: chash_initialize (chash.c:139)
==24137== by 0x400BA1: alloc_free (basic.c:16)
==24137== by 0x400C35: main (basic.c:27)

minor problem but annoying because it forces initialization at user level.

/rocco

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant