commit 23e7f0a7f0c3f96383dc74f926f02787178a2b45 parent 74c8d15e7e4e737b69c0a2d23790dcdb64db3e46 Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Wed, 26 Oct 2022 15:33:00 +0200 test/error: Add error/0031-krtypes.c Diffstat:
A | tests/cc/error/0031-krtypes.c | | | 37 | +++++++++++++++++++++++++++++++++++++ |
M | tests/cc/error/scc-tests.lst | | | 1 | + |
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/tests/cc/error/0031-krtypes.c b/tests/cc/error/0031-krtypes.c @@ -0,0 +1,37 @@ +/* +PATTERN: +0031-krtypes.c:32: error: incompatible types when assigning +0031-krtypes.c:33: error: incompatible types when assigning +0031-krtypes.c:34: error: incompatible types when assigning +. +*/ + +int +f1(char c) +{ + return c; +} + +int +f2(float c) +{ + return c; +} + +int +f3(int a, ...) +{ + return a; +} + +int +main() +{ + int (*fp)(); + + fp = f1; + fp = f2; + fp = f3; + + return 0; +} diff --git a/tests/cc/error/scc-tests.lst b/tests/cc/error/scc-tests.lst @@ -28,3 +28,4 @@ 0028-noconstinit.c [TODO] 0029-eof.c 0030-krtypes.c +0031-krtypes.c