URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 298 |
Rev 338 |
/* Spurious uninit variable warnings, case 4.
|
/* Spurious uninit variable warnings, case 4.
|
Simplified version of cppexp.c (cpp_parse_expr).
|
Simplified version of cppexp.c (cpp_parse_expr).
|
|
|
This one is really fragile, it gets it right if you take out case
|
This one is really fragile, it gets it right if you take out case
|
1, or if the structure is replaced by an int, or if the structure
|
1, or if the structure is replaced by an int, or if the structure
|
has fewer members (!) */
|
has fewer members (!) */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-Wuninitialized" } */
|
/* { dg-options "-Wuninitialized" } */
|
|
|
extern void abort (void);
|
extern void abort (void);
|
|
|
struct operation {
|
struct operation {
|
short op;
|
short op;
|
char rprio;
|
char rprio;
|
char flags;
|
char flags;
|
char unsignedp;
|
char unsignedp;
|
long value;
|
long value;
|
};
|
};
|
|
|
extern struct operation cpp_lex (void);
|
extern struct operation cpp_lex (void);
|
|
|
void
|
void
|
cpp_parse_expr (void)
|
cpp_parse_expr (void)
|
{
|
{
|
int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" } */
|
int rprio; /* { dg-bogus "rprio" "uninitialized variable warning PR19833" } */
|
struct operation op;
|
struct operation op;
|
|
|
for (;;)
|
for (;;)
|
{
|
{
|
op = cpp_lex ();
|
op = cpp_lex ();
|
|
|
switch (op.op)
|
switch (op.op)
|
{
|
{
|
case 0:
|
case 0:
|
break;
|
break;
|
case 1:
|
case 1:
|
return;
|
return;
|
case 2:
|
case 2:
|
rprio = 1;
|
rprio = 1;
|
break;
|
break;
|
default:
|
default:
|
return;
|
return;
|
}
|
}
|
|
|
if (op.op == 0)
|
if (op.op == 0)
|
return;
|
return;
|
|
|
if (rprio != 1)
|
if (rprio != 1)
|
abort();
|
abort();
|
}
|
}
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.