URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 297 |
Rev 338 |
/* Origin: PR c/128 from Martin Sebor <sebor@roguewave.com>, adapted
|
/* Origin: PR c/128 from Martin Sebor <sebor@roguewave.com>, adapted
|
as a testcase by Joseph Myers <jsm28@cam.ac.uk>.
|
as a testcase by Joseph Myers <jsm28@cam.ac.uk>.
|
*/
|
*/
|
/* Character arrays initialized by a string literal must have
|
/* Character arrays initialized by a string literal must have
|
uninitialized elements zeroed. This isn't clear in the 1990
|
uninitialized elements zeroed. This isn't clear in the 1990
|
standard, but was fixed in TC2 and C99; see DRs #060, #092.
|
standard, but was fixed in TC2 and C99; see DRs #060, #092.
|
*/
|
*/
|
extern void abort (void);
|
extern void abort (void);
|
|
|
int
|
int
|
foo (void)
|
foo (void)
|
{
|
{
|
char s[2] = "";
|
char s[2] = "";
|
return 0 == s[1];
|
return 0 == s[1];
|
}
|
}
|
|
|
char *t;
|
char *t;
|
|
|
int
|
int
|
main (void)
|
main (void)
|
{
|
{
|
{
|
{
|
char s[] = "x";
|
char s[] = "x";
|
t = s;
|
t = s;
|
}
|
}
|
if (foo ())
|
if (foo ())
|
exit (0);
|
exit (0);
|
else
|
else
|
abort ();
|
abort ();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.