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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [Wstring-literal-comparison-1.c] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
/* PR c/7776 */
2
/* { dg-do compile } */
3
/* { dg-options "-Waddress" } */
4
 
5
int test1(char *ptr)
6
{
7
  return ptr == "foo";  /* { dg-warning "comparison with string" } */
8
}
9
 
10
int test2()
11
{
12
  return "foo" != (const char*)0;
13
}
14
 
15
int test3()
16
{
17
  return "foo" == (const char*)0;
18
}
19
 
20
int test4()
21
{
22
  return (const char*)0 != "foo";
23
}
24
 
25
int test5()
26
{
27
  return (const char*)0 == "foo";
28
}
29
 

powered by: WebSVN 2.1.0

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