#include <stdio.h> int main(int argc, char *argv[]) { int click; click++; printf("click is %d \n",click); return 0; }
compile and execute: test $: g++ -o gccbug gccbug.cpp test $: ./gccbug click is 1 In this case click is set to zero. When I found this bug in a more complex program click had been set to -1 initially. -- Summary: undiagnosed uninitialized variable Product: gcc Version: 4.4.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: kornelix at yahoo dot de http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42133