Skip to content
Snippets Groups Projects
Commit 11d8d193 authored by Virgile Prevosto's avatar Virgile Prevosto
Browse files

[tests] add a few more tests for nested implicit calls

parent e9522581
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,10 @@
STDOPT: #"-cpp-extra-args=-DINCOMP1"
STDOPT: #"-cpp-extra-args=-DINCOMP2"
STDOPT: #"-cpp-extra-args=-DINCOMP3"
STDOPT: #"-cpp-extra-args=-DINCOMP4"
STDOPT: #"-cpp-extra-args=-DINCOMP5"
STDOPT: #"-cpp-extra-args=-DINCOMP6"
STDOPT: #"-cpp-extra-args=-DINCOMP7"
*/
#ifdef INCOMP1
......@@ -16,3 +20,19 @@
#ifdef INCOMP3
void foo(int x) { bar(bar); }
#endif
#ifdef INCOMP4
void foo(unsigned x) { bar((&bar)(0,12),x); }
#endif
#ifdef INCOMP5
void foo(unsigned x) { bar((&bar)(0),x); }
#endif
#ifdef INCOMP6
void foo(unsigned x) { bar(&bar); }
#endif
#ifdef INCOMP7
void foo(unsigned x) { bar(x,bar(0, 12)); }
#endif
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:9: Warning:
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:13: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel] issue-641-implicit-calls.c:9: User Error:
[kernel] issue-641-implicit-calls.c:13: User Error:
nested calls of bar without a prototype and incompatible arguments : different integer types:
'int' and 'unsigned int'
7
8 #ifdef INCOMP1
9 void foo(unsigned x) { bar(bar(0, 12), x); }
11
12 #ifdef INCOMP1
13 void foo(unsigned x) { bar(bar(0, 12), x); }
^^^^^^^^^^^^^^^^^^
10 #endif
11
14 #endif
15
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:13: Warning:
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:17: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel] issue-641-implicit-calls.c:13: User Error:
[kernel] issue-641-implicit-calls.c:17: User Error:
nested calls of bar without a prototype and incompatible arguments : different number of arguments
11
12 #ifdef INCOMP2
13 void foo(int x) { bar(bar(0), x); }
15
16 #ifdef INCOMP2
17 void foo(int x) { bar(bar(0), x); }
^^^^^^^^^^^^^^
14 #endif
15
18 #endif
19
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:17: Warning:
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:21: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel] issue-641-implicit-calls.c:17: User Error:
[kernel] issue-641-implicit-calls.c:21: User Error:
call to bar with a reference to itself in its own parameters
15
16 #ifdef INCOMP3
17 void foo(int x) { bar(bar); }
19
20 #ifdef INCOMP3
21 void foo(int x) { bar(bar); }
^^^^^^^^
18 #endif
22 #endif
23
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:25: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel:typing:no-proto] issue-641-implicit-calls.c:25: Warning:
Calling function bar that is declared without prototype.
Its formals will be inferred from actual arguments
[kernel] issue-641-implicit-calls.c:25: User Error:
nested calls of bar without a prototype and incompatible arguments : different integer types:
'int' and 'unsigned int'
23
24 #ifdef INCOMP4
25 void foo(unsigned x) { bar((&bar)(0,12),x); }
^^^^^^^^^^^^^^^^^^^
26 #endif
27
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:29: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel:typing:no-proto] issue-641-implicit-calls.c:29: Warning:
Calling function bar that is declared without prototype.
Its formals will be inferred from actual arguments
[kernel] issue-641-implicit-calls.c:29: User Error:
nested calls of bar without a prototype and incompatible arguments : different number of arguments
27
28 #ifdef INCOMP5
29 void foo(unsigned x) { bar((&bar)(0),x); }
^^^^^^^^^^^^^^^^
30 #endif
31
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:33: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel] issue-641-implicit-calls.c:33: User Error:
call to bar with a reference to itself in its own parameters
31
32 #ifdef INCOMP6
33 void foo(unsigned x) { bar(&bar); }
^^^^^^^^^
34 #endif
35
[kernel] Frama-C aborted: invalid user input.
[kernel] Parsing issue-641-implicit-calls.c (with preprocessing)
[kernel:typing:implicit-function-declaration] issue-641-implicit-calls.c:37: Warning:
Calling undeclared function bar. Old style K&R code?
[kernel] issue-641-implicit-calls.c:37: User Error:
nested calls of bar without a prototype and incompatible arguments : different integer types:
'int' and 'unsigned int'
35
36 #ifdef INCOMP7
37 void foo(unsigned x) { bar(x,bar(0, 12)); }
^^^^^^^^^^^^^^^^^
38 #endif
[kernel] Frama-C aborted: invalid user input.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment