Skip to content

Commit

Permalink
cl/tests: make the code compile with gcc-14.x
Browse files Browse the repository at this point in the history
This commit fixes the following errors:
```
In file included from cl/tests/data/vk-0100.c:1:
cl/../include/predator-builtins/verifier-builtins.h: In function '__VERIFIER_error':
cl/../include/predator-builtins/verifier-builtins.h:119:5: error: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:1:1: note: include '<stdlib.h>' or provide a declaration of 'abort'
  +++ |+#include <stdlib.h>
    1 | /*
cl/../include/predator-builtins/verifier-builtins.h:119:5: warning: incompatible implicit declaration of built-in function 'abort' [-Wbuiltin-declaration-mismatch]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:119:5: note: include '<stdlib.h>' or provide a declaration of 'abort'
cl_build/tests/libchk_var_killer.so: warning: some errors already detected, additional passes will be skipped

In file included from cl/tests/data/vk-0101.c:1:
cl/../include/predator-builtins/verifier-builtins.h: In function '__VERIFIER_error':
cl/../include/predator-builtins/verifier-builtins.h:119:5: error: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:1:1: note: include '<stdlib.h>' or provide a declaration of 'abort'
  +++ |+#include <stdlib.h>
    1 | /*
cl/../include/predator-builtins/verifier-builtins.h:119:5: warning: incompatible implicit declaration of built-in function 'abort' [-Wbuiltin-declaration-mismatch]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:119:5: note: include '<stdlib.h>' or provide a declaration of 'abort'
cl_build/tests/libchk_var_killer.so: warning: some errors already detected, additional passes will be skipped

cl/tests/data/pt-0850.c: In function 'main':
cl/tests/data/pt-0850.c:16:10: error: assignment to 'int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   16 |     ptrB = &ptrC;
      |          ^
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped

cl/tests/data/pt-0950.c: In function 'test':
cl/tests/data/pt-0950.c:13:8: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   13 |     *p = &i;
      |        ^
cl/tests/data/pt-0950.c: In function 'main':
cl/tests/data/pt-0950.c:21:7: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   21 |     i = &j;
      |       ^
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped

In file included from cl/tests/data/pt-1203.c:3:
cl/../include/predator-builtins/verifier-builtins.h: In function '__VERIFIER_error':
cl/../include/predator-builtins/verifier-builtins.h:119:5: error: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:1:1: note: include '<stdlib.h>' or provide a declaration of 'abort'
  +++ |+#include <stdlib.h>
    1 | /*
cl/../include/predator-builtins/verifier-builtins.h:119:5: warning: incompatible implicit declaration of built-in function 'abort' [-Wbuiltin-declaration-mismatch]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:119:5: note: include '<stdlib.h>' or provide a declaration of 'abort'
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped

In file included from cl/tests/data/pt-1300.c:2:
cl/../include/predator-builtins/verifier-builtins.h: In function '__VERIFIER_error':
cl/../include/predator-builtins/verifier-builtins.h:119:5: error: implicit declaration of function 'abort' [-Wimplicit-function-declaration]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:1:1: note: include '<stdlib.h>' or provide a declaration of 'abort'
  +++ |+#include <stdlib.h>
    1 | /*
cl/../include/predator-builtins/verifier-builtins.h:119:5: warning: incompatible implicit declaration of built-in function 'abort' [-Wbuiltin-declaration-mismatch]
  119 |     abort();
      |     ^~~~~
cl/../include/predator-builtins/verifier-builtins.h:119:5: note: include '<stdlib.h>' or provide a declaration of 'abort'
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped

cl/tests/data/pt-0850.c: In function 'main':
cl/tests/data/pt-0850.c:16:10: error: assignment to 'int *' from incompatible pointer type 'int **' [-Wincompatible-pointer-types]
   16 |     ptrB = &ptrC;
      |          ^
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped

cl/tests/data/pt-0950.c: In function 'test':
cl/tests/data/pt-0950.c:13:8: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   13 |     *p = &i;
      |        ^
cl/tests/data/pt-0950.c: In function 'main':
cl/tests/data/pt-0950.c:21:7: error: assignment to 'int' from 'int *' makes integer from pointer without a cast [-Wint-conversion]
   21 |     i = &j;
      |       ^
cl_build/tests/libchk_pt.so: warning: some errors already detected, additional passes will be skipped
```

Related: #92
Related: #93
  • Loading branch information
kdudka committed Mar 1, 2024
1 parent baa880d commit 57b907c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cl/tests/data/pt-0850.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ int *ptrA, *ptrB, *ptrC;
int main()
{
ptrA = ptrB;
ptrB = &ptrC;
ptrB = (void *) &ptrC;
}
4 changes: 2 additions & 2 deletions cl/tests/data/pt-0950.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ int test(int *p)
// Note that we are accessing local variable! This is just for points-to
// test purposes.

*p = &i;
*p = (long) &i;
}


int main(int argc, char **argv)
{
int i, j;

i = &j;
i = (long) &j;

// ___cl_pt_points_glob_y(i, j);

Expand Down
2 changes: 2 additions & 0 deletions include/predator-builtins/verifier-builtins.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ void __VERIFIER_error() __attribute__ ((__noreturn__));
* sl.h:62:25: error: ‘int __VERIFIER_nondet_int()’ defined but not used
*/

# include <stdlib.h> // for abort();

static /* inline */ void ___sl_break(const char *msg)
{
(void) msg;
Expand Down

0 comments on commit 57b907c

Please sign in to comment.