expressions: make assign_expression() take an op argument
[smatch.git] / validation / function-redecl.c
blob475f18e798f59517d6d182340cce01c3fc92a078
1 #define __user __attribute__((address_space(1)))
2 #define NULL ((void*)0)
4 int ret_type(void);
5 void ret_type(void) { } /* check-should-fail */
8 int ret_const(void);
9 int const ret_const(void) { return 0; } /* check-should-fail */
12 void *ret_as(void);
13 void __user *ret_as(void) { return NULL; } /* check-should-fail */
16 void *ret_mod(void);
17 void const *ret_mod(void) { return NULL; } /* check-should-fail */
20 void arg_type(int a);
21 void arg_type(void *a) { } /* check-should-fail */
24 void arg_const(int a);
25 void arg_const(const int a) { } /* OK */
28 void arg_as(void *a);
29 void arg_as(void __user *a) { } /* check-should-fail */
32 void arg_mod(void *);
33 void arg_mod(void const *a) { } /* check-should-fail */
36 void arg_more_arg(int a);
37 void arg_more_arg(int a, int b) { } /* check-should-fail */
40 void arg_less_arg(int a, int b);
41 void arg_less_arg(int a) { } /* check-should-fail */
44 void arg_vararg(int a);
45 void arg_vararg(int a, ...) { } /* check-should-fail */
48 * check-name: function-redecl
50 * check-error-start
51 function-redecl.c:5:6: error: symbol 'ret_type' redeclared with different type (originally declared at function-redecl.c:4) - different base types
52 function-redecl.c:9:11: error: symbol 'ret_const' redeclared with different type (originally declared at function-redecl.c:8) - different modifiers
53 function-redecl.c:13:13: error: symbol 'ret_as' redeclared with different type (originally declared at function-redecl.c:12) - different address spaces
54 function-redecl.c:17:12: error: symbol 'ret_mod' redeclared with different type (originally declared at function-redecl.c:16) - different modifiers
55 function-redecl.c:21:6: error: symbol 'arg_type' redeclared with different type (originally declared at function-redecl.c:20) - incompatible argument 1 (different base types)
56 function-redecl.c:29:6: error: symbol 'arg_as' redeclared with different type (originally declared at function-redecl.c:28) - incompatible argument 1 (different address spaces)
57 function-redecl.c:33:6: error: symbol 'arg_mod' redeclared with different type (originally declared at function-redecl.c:32) - incompatible argument 1 (different modifiers)
58 function-redecl.c:37:6: error: symbol 'arg_more_arg' redeclared with different type (originally declared at function-redecl.c:36) - different argument counts
59 function-redecl.c:41:6: error: symbol 'arg_less_arg' redeclared with different type (originally declared at function-redecl.c:40) - different argument counts
60 function-redecl.c:45:6: error: symbol 'arg_vararg' redeclared with different type (originally declared at function-redecl.c:44) - incompatible variadic arguments
61 * check-error-end