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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [warn/] [pointer-integer-comparison.C] - Blame information for rev 701

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

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
// { dg-options "-fsyntax-only -fpermissive" }
3
 
4
int foo (int i, void *p)
5
{
6
  if (i == p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
7
    return 0;
8
  else if (i != p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
9
    return 1;
10
}
11
 
12
int bar (int i, void *p)
13
{
14
  if (i < p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
15
    return 0;
16
  else if (i >= p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
17
    return 1;
18
}
19
 
20
int baz (int i, void *p)
21
{
22
  if (i <= p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
23
    return 0;
24
  else if (i > p) // { dg-warning "ISO C.. forbids comparison between pointer and integer" }
25
    return 1;
26
}

powered by: WebSVN 2.1.0

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