Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/Wstrict-aliasing-8.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* { dg-do compile } */ |
2 /* { dg-options "-Wstrict-aliasing=2 -O2 -Wall" } */ | |
3 | |
4 int a[2]; | |
5 | |
6 double *foo1(void) | |
7 { | |
8 return (double *)a; /* { dg-warning "strict-aliasing" } */ | |
9 } | |
10 | |
11 double *foo2(void) | |
12 { | |
13 return (double *)&a[0]; /* { dg-warning "strict-aliasing" } */ | |
14 } | |
15 | |
16 __complex__ double x; | |
17 int *bar(void) | |
18 { | |
19 return (int *)&__imag__ x; /* { dg-warning "strict-aliasing" } */ | |
20 } |