File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Author: Daniel Kroening, kroening@kroening.com
8
8
9
9
#include " ansi_c_internal_additions.h"
10
10
11
+ #include < util/c_types.h>
11
12
#include < util/config.h>
12
13
13
14
#include < linking/static_lifetime_init.h>
@@ -126,6 +127,8 @@ void ansi_c_internal_additions(std::string &code)
126
127
code+=
127
128
" # 1 \" <built-in-additions>\"\n "
128
129
" typedef __typeof__(sizeof(int)) __CPROVER_size_t;\n "
130
+ " typedef " +c_type_as_string (signed_size_type ().get (ID_C_c_type))+
131
+ " __CPROVER_ssize_t;\n "
129
132
" const unsigned __CPROVER_constant_infinity_uint;\n "
130
133
" typedef void __CPROVER_integer;\n "
131
134
" typedef void __CPROVER_rational;\n "
Original file line number Diff line number Diff line change @@ -33,9 +33,9 @@ void __CPROVER_fence(const char *kind, ...);
33
33
void CBMC_trace (int lvl , const char * event , ...);
34
34
35
35
// pointers
36
- unsigned __CPROVER_POINTER_OBJECT (const void * p );
37
- signed __CPROVER_POINTER_OFFSET (const void * p );
38
- __CPROVER_bool __CPROVER_DYNAMIC_OBJECT (const void * p );
36
+ __CPROVER_size_t __CPROVER_POINTER_OBJECT (const void * );
37
+ __CPROVER_ssize_t __CPROVER_POINTER_OFFSET (const void * );
38
+ __CPROVER_bool __CPROVER_DYNAMIC_OBJECT (const void * );
39
39
void __CPROVER_allocated_memory (__CPROVER_size_t address , __CPROVER_size_t extent );
40
40
41
41
// float stuff
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ Author: Daniel Kroening, kroening@kroening.com
10
10
11
11
#include < ostream>
12
12
13
+ #include < util/c_types.h>
13
14
#include < util/config.h>
14
15
15
16
#include < ansi-c/ansi_c_internal_additions.h>
@@ -64,7 +65,11 @@ void cpp_internal_additions(std::ostream &out)
64
65
65
66
// types
66
67
out << " typedef __typeof__(sizeof(int)) __CPROVER::size_t;" << ' \n ' ;
67
- out << " typedef __typeof__(sizeof(int)) __CPROVER_size_t;" << ' \n ' ;
68
+ out << " typedef __CPROVER::size_t __CPROVER_size_t;" << ' \n ' ;
69
+ out << " typedef "
70
+ << c_type_as_string (signed_size_type ().get (ID_C_c_type))
71
+ << " __CPROVER::ssize_t;" << ' \n ' ;
72
+ out << " typedef __CPROVER::ssize_t __CPROVER_ssize_t;" << ' \n ' ;
68
73
69
74
// assume/assert
70
75
out << " extern \" C\" void assert(bool assertion);" << ' \n ' ;
@@ -85,8 +90,8 @@ void cpp_internal_additions(std::ostream &out)
85
90
out << " extern \" C\" void __CPROVER::atomic_end();" << ' \n ' ;
86
91
87
92
// pointers
88
- out << " extern \" C\" unsigned __CPROVER_POINTER_OBJECT(const void *p );\n " ;
89
- out << " extern \" C\" signed __CPROVER_POINTER_OFFSET(const void *p );" << ' \n ' ;
93
+ out << " extern \" C\" __CPROVER::size_t __CPROVER_POINTER_OBJECT(const void *);\n " ;
94
+ out << " extern \" C\" __CPROVER::ssize_t __CPROVER_POINTER_OFFSET(const void *);" << ' \n ' ;
90
95
out << " extern \" C\" bool __CPROVER_DYNAMIC_OBJECT(const void *p);" << ' \n ' ;
91
96
// NOLINTNEXTLINE(whitespace/line_length)
92
97
out << " extern \" C\" extern unsigned char __CPROVER_memory[__CPROVER::constant_infinity_uint];" << ' \n ' ;
You can’t perform that action at this time.
0 commit comments