Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/gcc.dg/format/ms_cast-1.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 /* Test for strings cast through integer types: should not be treated |
2 as format strings unless the types are of the same width as | |
3 pointers (intptr_t or similar). */ | |
4 /* Origin: Joseph Myers <joseph@codesourcery.com> */ | |
5 /* { dg-do compile { target { *-*-mingw* } } } */ | |
6 /* { dg-options "-Wformat" } */ | |
7 | |
8 #define USE_SYSTEM_FORMATS | |
9 #include "format.h" | |
10 | |
11 void | |
12 f (int x) | |
13 { | |
14 printf("%s", x); /* { dg-warning "format" } */ | |
15 printf((char *)(size_t)"%s", x); /* { dg-warning "format" } */ | |
16 printf((char *)(char)"%s", x); /* { dg-warning "cast from pointer to integer of different size" } */ | |
17 } |