]> git.sur5r.net Git - cc65/blob - test/val/cc65150311.c
goto.c warning fix for implicit truncation
[cc65] / test / val / cc65150311.c
1 /*
2   !!DESCRIPTION!! function pointer bugs
3   !!ORIGIN!!      testsuite
4   !!LICENCE!!     Public Domain
5   !!AUTHOR!!      Greg
6 */
7
8 /*
9   see: http://www.cc65.org/mailarchive/2015-03/11726.html
10   and: http://www.cc65.org/mailarchive/2015-03/11734.html
11 */
12
13 static int func(void) {return 0;}
14 static int (*p)(void);
15 static int n;
16
17 int main(void) {
18
19     p = func;
20     n = (p == &func);
21     n = (p == func);
22
23 /* the following are not valid C and should go into seperate tests that MUST fail */
24 /*
25     ++p;
26     n = (p > &func);
27     n = (p > func);
28     n = func - func;
29     n = func - &func;
30     n = &func - func;
31     n = &func - &func;
32     n = p - &func;
33     n = p - func;
34     n = &func - p;
35     n = func - p;
36 */
37     return 0;
38 }