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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [c90-const-expr-10.c] - Blame information for rev 826

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* Test for constant expressions: invalid null pointer constants in
2
   various contexts (make sure NOPs are not inappropriately
3
   stripped).  */
4
/* Origin: Joseph Myers <joseph@codesourcery.com> */
5
/* { dg-do compile } */
6
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
7
 
8
__extension__ typedef __SIZE_TYPE__ size_t;
9
 
10
void *p = (size_t)(void *)0; /* { dg-error "without a cast" } */
11
struct s { void *a; } q = { (size_t)(void *)0 }; /* { dg-error "without a cast" } */
12
void *
13
f (void)
14
{
15
  void *r;
16
  r = (size_t)(void *)0; /* { dg-error "without a cast" } */
17
  return (size_t)(void *)0; /* { dg-error "without a cast" } */
18
}
19
void g (void *); /* { dg-message "but argument is of type" } */
20
void
21
h (void)
22
{
23
  g ((size_t)(void *)0); /* { dg-error "without a cast" } */
24
}
25
void g2 (int, void *); /* { dg-message "but argument is of type" } */
26
void
27
h2 (void)
28
{
29
  g2 (0, (size_t)(void *)0); /* { dg-error "without a cast" } */
30
}

powered by: WebSVN 2.1.0

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