invalid-call-1.c

来自「用于进行gcc测试」· C语言 代码 · 共 19 行

C
19
字号
/* PR rtl-optimization/29841 *//* Testcase by Khem Raj <raj.khem@gmail.com> *//* { dg-do compile } *//* { dg-options "-O2" } *//* { dg-options "-O2 -march=i586" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */typedef void (*fp)(void);extern char* bar(void* a1, int a2);extern char* mar(int n);char* cptr;void foo(){  cptr = mar(6);  ((char *(*)(void *,int (*)(void *,unsigned char **),char**))((fp)bar))(0,0,(void*)(0)); /* { dg-warning "function called through a non-compatible type" "non-compatible type" } */  /* { dg-message "note: if this code is reached, the program will abort" "" { target *-*-* } 16 } */}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?