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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [Wchar-subscripts-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test -Wchar-subscripts.  */
2
/* Origin: Joseph Myers <joseph@codesourcery.com> */
3
/* { dg-do compile } */
4
/* { dg-options "-Wchar-subscripts" } */
5
 
6
extern int a[];
7
int *p;
8
char c;
9
signed char sc;
10
unsigned char uc;
11
 
12
void
13
f (void)
14
{
15
  a[sc];
16
  a[uc];
17
  sc[a];
18
  uc[a];
19
  p[sc];
20
  p[uc];
21
  sc[p];
22
  uc[p];
23
  a[c]; /* { dg-warning "array subscript has type 'char'" } */
24
  p[c]; /* { dg-warning "array subscript has type 'char'" } */
25
  /* -Wchar-subscripts does not warn if the char is not syntactically
26
      the subscript.  */
27
  c[a];
28
  c[p];
29
}

powered by: WebSVN 2.1.0

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