OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [array-6.c] - Blame information for rev 303

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* PR c/5597 */
2
/* { dg-do compile } */
3
/* { dg-options "" } */
4
 
5
/* Verify that GCC forbids non-static initialization of
6
   flexible array members. */
7
 
8
struct str { int len; char s[]; };
9
 
10
struct str a = { 2, "a" };
11
 
12
void foo()
13
{
14
  static struct str b = { 2, "b" };
15
  struct str c = { 2, "c" }; /* { dg-error "(non-static)|(near initialization)" } */
16
  struct str d = (struct str) { 2, "d" }; /* { dg-error "(non-static)|(near initialization)" } */
17
  struct str e = (struct str) { d.len, "e" }; /* { dg-error "(non-static)|(initialization)" } */
18
}

powered by: WebSVN 2.1.0

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