(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
uninit-21.c
       1  /* PR69537, spurious warning because of a missed optimization. */
       2  /* { dg-do compile } */
       3  /* { dg-options "-O2 -fno-short-enums -Wuninitialized" } */
       4  
       5  enum clnt_stat {
       6   RPC_SUCCESS=0,
       7   RPC_CANTENCODEARGS=1,
       8  };
       9   
      10  int do_ypcall_tr ();
      11   
      12  static int
      13  yp_master (char **outname)
      14  {
      15    // Replacing enum clnt_stat with int avoids the warning.
      16    enum clnt_stat result;
      17    result = do_ypcall_tr ();
      18    if (result != 0)
      19      return result;
      20    *outname = __builtin_strdup ("foo");
      21    return 0;
      22  }
      23   
      24  int
      25  yp_update (void)
      26  {
      27    char *master;
      28    int r;
      29    if ((r = yp_master (&master)) != 0)
      30      return r;
      31    __builtin_free (master); /* { dg-bogus "uninitialized" } */
      32    return 0;
      33  }