URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* Test -Wchar-subscripts. */
|
/* Test -Wchar-subscripts. */
|
/* Origin: Joseph Myers <joseph@codesourcery.com> */
|
/* Origin: Joseph Myers <joseph@codesourcery.com> */
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-Wchar-subscripts" } */
|
/* { dg-options "-Wchar-subscripts" } */
|
|
|
extern int a[];
|
extern int a[];
|
int *p;
|
int *p;
|
char c;
|
char c;
|
signed char sc;
|
signed char sc;
|
unsigned char uc;
|
unsigned char uc;
|
|
|
void
|
void
|
f (void)
|
f (void)
|
{
|
{
|
a[sc];
|
a[sc];
|
a[uc];
|
a[uc];
|
sc[a];
|
sc[a];
|
uc[a];
|
uc[a];
|
p[sc];
|
p[sc];
|
p[uc];
|
p[uc];
|
sc[p];
|
sc[p];
|
uc[p];
|
uc[p];
|
a[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
|
a[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
|
p[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
|
p[c]; /* { dg-warning "warning: array subscript has type 'char'" } */
|
/* -Wchar-subscripts does not warn if the char is not syntactically
|
/* -Wchar-subscripts does not warn if the char is not syntactically
|
the subscript. */
|
the subscript. */
|
c[a];
|
c[a];
|
c[p];
|
c[p];
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.