(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
scope-1.c
       1  #include <stdlib.h>
       2  
       3  int test_1 (void)
       4  {
       5    {
       6      int *q = malloc (1024);
       7    }
       8  
       9    return 42; /* { dg-warning "leak of 'q'" } */
      10    // FIXME: would be better to report it at the close-of-scope
      11  }
      12  
      13  int test_2 (void)
      14  {
      15    {
      16      void *q = malloc (1024);
      17    }
      18  
      19    int q = 42;
      20  
      21    return q; /* { dg-warning "leak of 'q'" } */
      22    // FIXME: would be better to report it at the close-of-scope
      23  }