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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [Wchar-subscripts-1.c] - Diff between revs 149 and 154

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];
}
}
 
 

powered by: WebSVN 2.1.0

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