(root)/
gcc-13.2.0/
gcc/
testsuite/
gcc.dg/
analyzer/
fgets-1.c
       1  /* { dg-do "compile" } */
       2  
       3  #define NULL ((void *) 0)
       4  typedef struct _IO_FILE FILE;
       5  
       6  extern char *fgets(char *__restrict __s, int __n,
       7  		   FILE *__restrict __stream);
       8  extern char *fgets_unlocked(char *__restrict __s, int __n,
       9  			    FILE *__restrict __stream);
      10  
      11  char
      12  test_1 (FILE *fp)
      13  {
      14    char buf[400];
      15  
      16    if (fgets (buf, sizeof buf, fp) == NULL)
      17      return 0;
      18  
      19    return buf[0];
      20  }
      21  
      22  char
      23  test_2 (FILE *fp)
      24  {
      25    char buf[400];
      26  
      27    if (fgets_unlocked (buf, sizeof buf, fp) == NULL)
      28      return 0;
      29  
      30    return buf[0];
      31  }