$gcc -O -Wextra -save-temps um3.c
$

um3.c

#include <stdio.h>

main()
{
char *J;

if (rand())
  J = NULL;

printf("\ntest %s\n",J);
}


In this example, J could be used uninitialized but the compiler is not giving
that warning.


-- 
           Summary: no warning that a variable may be used uninitialized
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dhill at clusterresources dot com
 GCC build triplet: --build=x86_64-linux-gnu
  GCC host triplet: --host=x86_64-linux-gnu
GCC target triplet: --target=x86_64-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113

Reply via email to