I am trying to learn C and am reading about valgrind. I have a simple C program, shown below, and when I run valgrind it complains about
Conditional jump or move depends on uninitialised value
by 0x100000F50: main (ex5.c:9)
==4338== Uninitialised value was created by a stack allocation
==4338== at 0x1001F5BF8: __vfprintf (in /usr/lib/system/libsystem_c.dylib)
#include <stdio.h>
/* This is a comment. */
int main(int argc, char *argv[])
{
int distance = 100;
// this is also a comment
printf("You are %d miles away.\n", distance);
return 0;
}
Where is the error coming from?