OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [uninit-3-O0.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* Spurious uninit variable warnings, case 3.
2
   Inspired by cppexp.c (parse_charconst) */
3
/* { dg-do compile } */
4
/* { dg-options "-Wuninitialized" } */
5
 
6
extern void error (char *);
7
 
8
int
9
parse_charconst (const char *start, const char *end)
10
{
11
  int c; /* { dg-bogus "c" "uninitialized variable warning" } */
12
  int nchars, retval;
13
 
14
  nchars = 0;
15
  retval = 0;
16
  while (start < end)
17
    {
18
      c = *start++;
19
      if (c == '\'')
20
        break;
21
      nchars++;
22
      retval += c;
23
      retval <<= 8;
24
    }
25
 
26
  if (nchars == 0)
27
    return 0;
28
 
29
  if (c != '\'')
30
    error ("malformed character constant");
31
 
32
  return retval;
33
}

powered by: WebSVN 2.1.0

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