OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [uninit-1.c] - Blame information for rev 154

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Spurious uninitialized variable warnings, case 1.
2
   Taken from cppfiles.c (merge_include_chains) */
3
/* { dg-do compile } */
4
/* { dg-options "-O -Wuninitialized" } */
5
 
6
struct list
7
{
8
  struct list *next;
9
  int id;
10
};
11
 
12
extern void free (void *);
13
 
14
void remove_dupes (struct list *el)
15
{
16
  struct list *p, *q, *r;  /* { dg-bogus "r" "uninitialized variable warning" } */
17
 
18
  for (p = el; p; p = p->next)
19
  {
20
    for (q = el; q != p; q = q->next)
21
      if (q->id == p->id)
22
      {
23
        r->next = p->next;
24
        free (p);
25
        p = r;
26
        break;
27
      }
28
    r = p;
29
  }
30
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.