http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49617
Summary: gcc misses uninititialized variables in contained functions Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: pa...@gcc.gnu.org This was reported to the gfortran list by Bill Paxton: gfortran test_uninit.f -O2 -Wall -o test; ./test module test_mod implicit none contains subroutine test integer :: x, y call t write(*,*) 'y', y contains subroutine t y = x * 5 end subroutine t end subroutine test end module test_mod program test_uninit use test_mod implicit none call test end program test_uninit No warning is given that 'x' is used uninitialized in subroutine 't'. The uninitialized checking is done in tree-ssa.c and tree-ssa-uninit.c, so this should be attributed to gcc. Tobias Burnus produced this (using gcc extension) testcase in C int main (void) { int y; int func(void) { int x; /*int z;*/ x = y; /* x = z;*/ return x; } return func(); } This also fails to report on the state of y, when used in 'func'. I understand that fixing this will not be straightforward but have submitted it for the record at least. Paul