Commit 9e27f6b0 authored by Andre Maroneze's avatar Andre Maroneze 💬
Browse files

Merge branch 'feature/typing/less-casts' into 'master'

Companion MR to frama-c!3654: update oracles

See merge request frama-c/frama-clang!167
parents b694541f 7ce9713d
Pipeline #43902 failed with stages
......@@ -2,11 +2,11 @@
Now output intermediate result
/* Generated by Frama-C */
typedef void *nullptr_t;
nullptr_t x = (void *)0;
nullptr_t x = (nullptr_t)0;
int main(void)
{
int __retres;
if (x == (void *)0) {
if (x == (nullptr_t)0) {
__retres = 0;
goto return_label;
}
......
......@@ -32,6 +32,7 @@ struct integral_constant<bool,1>;
struct integral_constant<bool,1> {
};
typedef int type;
enum E {
A = 1,
B = 2
......@@ -115,7 +116,7 @@ struct _frama_c_rtti_name_info_node _frama_c_rtti_name_info =
int f(void)
{
int __retres;
__retres = (int)((enum E)A);
__retres = (type)((enum E)A);
return __retres;
}
......
......@@ -75,7 +75,7 @@ struct A nil(void)
{
struct A ret;
A::Ctor(& ret);
ret.anonymous_1.raw = (unsigned short)0;
ret.anonymous_1.raw = (u16_t)0;
return ret;
}
......@@ -83,9 +83,9 @@ struct A one(void)
{
struct A ret;
A::Ctor(& ret);
ret.anonymous_1.str.prec = (unsigned short)((unsigned short)0);
ret.anonymous_1.str.main = (unsigned short)((unsigned short)1);
ret.anonymous_1.str.type = (unsigned short)((unsigned short)0);
ret.anonymous_1.str.prec = (u16_t)((u16_t)0);
ret.anonymous_1.str.main = (u16_t)((u16_t)1);
ret.anonymous_1.str.type = (u16_t)((u16_t)0);
return ret;
}
......
......@@ -163,7 +163,7 @@ struct _frama_c_rtti_name_info_node _frama_c_rtti_name_info;
void initializer_list<int>::Ctor(struct initializer_list<int> const *this)
{
this->base = (int const *)0;
this->length = (unsigned int)0;
this->length = (size_t)0;
return;
}
......@@ -2997,7 +2997,7 @@ void array<int,5>::Ctor(struct array<int,5> const *this,
{
size_type tmp_1;
iterator it = begin(l);
size_type i = (unsigned int)0;
size_type i = (size_type)0;
size_type len = size(l);
if (len < 5U) tmp_1 = len; else tmp_1 = 5U;
size_type end = tmp_1;
......@@ -3128,7 +3128,7 @@ void array<int,2>::Ctor(struct array<int,2> const *this,
{
size_type tmp_1;
iterator it = begin(l);
size_type i = (unsigned int)0;
size_type i = (size_type)0;
size_type len = size(l);
if (len < 2U) tmp_1 = len; else tmp_1 = 2U;
size_type end = tmp_1;
......@@ -3256,7 +3256,7 @@ void __fc_init_Z1a(void)
{
int const init_array[5UL] = {0, 1, 2, 3, 4};
struct initializer_list<int> init_list;
initializer_list<int>::Ctor(& init_list,init_array,(unsigned int)5);
initializer_list<int>::Ctor(& init_list,init_array,(size_t)5);
array<int,5>::Ctor((struct array<int,5> const *)(& a),
(struct initializer_list<int> const *)(& init_list));
return;
......@@ -3268,7 +3268,7 @@ void __fc_init_Z6search(void)
{
int const init_array[2UL] = {2, 3};
struct initializer_list<int> init_list;
initializer_list<int>::Ctor(& init_list,init_array,(unsigned int)2);
initializer_list<int>::Ctor(& init_list,init_array,(size_t)2);
array<int,2>::Ctor((struct array<int,2> const *)(& search),
(struct initializer_list<int> const *)(& init_list));
return;
......@@ -3280,7 +3280,7 @@ void __fc_init_Z1b(void)
{
int const init_array[5UL] = {5, 6, 7, 8, 9};
struct initializer_list<int> init_list;
initializer_list<int>::Ctor(& init_list,init_array,(unsigned int)5);
initializer_list<int>::Ctor(& init_list,init_array,(size_t)5);
array<int,5>::Ctor((struct array<int,5> const *)(& b),
(struct initializer_list<int> const *)(& init_list));
return;
......
......@@ -70,7 +70,7 @@ void f(void)
}
}
struct initializer_list<int> x;
initializer_list<int>::Ctor(& x,(int const *)(a),(unsigned int)2);
initializer_list<int>::Ctor(& x,(int const *)(a),(size_t)2);
return;
}
......
......@@ -155,7 +155,7 @@ struct _frama_c_rtti_name_info_node _frama_c_rtti_name_info;
void initializer_list<int>::Ctor(struct initializer_list<int> const *this)
{
this->base = (int const *)0;
this->length = (unsigned int)0;
this->length = (size_t)0;
return;
}
......@@ -432,7 +432,7 @@ void array<int,4>::Ctor(struct array<int,4> const *this,
{
size_type tmp_1;
iterator it = begin(l);
size_type i = (unsigned int)0;
size_type i = (size_type)0;
size_type len = size(l);
if (len < 4U) tmp_1 = len; else tmp_1 = 4U;
size_type end = tmp_1;
......@@ -568,7 +568,7 @@ void array<int,2>::Ctor(struct array<int,2> const *this,
{
size_type tmp_1;
iterator it = begin(l);
size_type i = (unsigned int)0;
size_type i = (size_type)0;
size_type len = size(l);
if (len < 2U) tmp_1 = len; else tmp_1 = 2U;
size_type end = tmp_1;
......@@ -735,7 +735,7 @@ int main(void)
reference tmp_1;
int const init_array[4UL] = {0, 1, 2, 3};
struct initializer_list<int> init_list;
initializer_list<int>::Ctor(& init_list,init_array,(unsigned int)4);
initializer_list<int>::Ctor(& init_list,init_array,(size_t)4);
struct array<int,4> A;
array<int,4>::Ctor(& A,(struct initializer_list<int> const *)(& init_list));
struct initializer_list<int> const __clang_tmp_4;
......@@ -744,9 +744,9 @@ int main(void)
array<int,2>::Ctor(& B,& __clang_tmp_4);
tmp = get<3,int,4>(& A);
int x = *tmp;
tmp_0 = operator[](& B,(unsigned int)1);
tmp_0 = operator[](& B,(size_t)1);
*tmp_0 = 42;
tmp_1 = at(& B,(unsigned int)0);
tmp_1 = at(& B,(size_t)0);
*tmp_1 = 36;
{
iterator it = begin(& A);
......
[kernel] Parsing stl_memory.cpp (external front-end)
Now output intermediate result
[kernel:typing:implicit-conv-void-ptr] stl_memory.cpp:13: Warning:
implicit conversion from void * to int *
implicit conversion from void * to pointer
[kernel:typing:implicit-conv-void-ptr] stl_memory.cpp:15: Warning:
implicit conversion from void * to int *
implicit conversion from void * to pointer
[kernel:typing:implicit-conv-void-ptr] stl_memory.cpp:21: Warning:
implicit conversion from void * to int *
implicit conversion from void * to pointer
[kernel] Warning: Assuming declared function exception::Dtor can't throw any exception
[kernel] Warning: Assuming declared function free can't throw any exception
[kernel] Warning: Assuming declared function free can't throw any exception
......@@ -2206,8 +2206,8 @@ void reset(struct unique_ptr<int[],std::default_delete<int[]>> *this,
{
pointer old = this->__ptr;
this->__ptr = p;
if (old != (int *)0) operator()((struct default_delete<int[]> const *)(& this->__dlt),
old);
if (old != (pointer)0) operator()((struct default_delete<int[]> const *)(& this->__dlt),
old);
return;
}
......@@ -2545,30 +2545,30 @@ int main(void)
int a = *tmp_1 + *tmp_2;
tmp_3 = malloc(sizeof(int));
struct unique_ptr<int,std::default_delete<int>> up;
unique_ptr<int,std::default_delete<int>>::Ctor(& up,(int *)tmp_3);
unique_ptr<int,std::default_delete<int>>::Ctor(& up,(pointer)tmp_3);
tmp_4 = operator*((struct unique_ptr<int,std::default_delete<int>> const *)(& up));
*tmp_4 = 1;
tmp_5 = malloc(sizeof(int));
struct unique_ptr<int,std::default_delete<int>> up1;
unique_ptr<int,std::default_delete<int>>::Ctor(& up1,(int *)tmp_5);
unique_ptr<int,std::default_delete<int>>::Ctor(& up1,(pointer)tmp_5);
tmp_6 = operator*((struct unique_ptr<int,std::default_delete<int>> const *)(& up1));
*tmp_6 = 2;
swap<int,std::default_delete<int>>(& up,& up1);
reset(& up1,(int *)0);
reset(& up1,(pointer)0);
tmp_7 = malloc(sizeof(int) * (unsigned int)2);
struct unique_ptr<int[],std::default_delete<int[]>> ua;
unique_ptr<int[],std::default_delete<int[]>>::Ctor(& ua,(int *)tmp_7);
unique_ptr<int[],std::default_delete<int[]>>::Ctor(& ua,(pointer)tmp_7);
tmp_8 = operator[]((struct unique_ptr<int[],std::default_delete<int[]>> const *)(& ua),
(unsigned int)1);
(size_t)1);
*tmp_8 = 3;
tmp_9 = forward<std::unique_ptr<int[],std::default_delete<int[]>>>(& ua);
struct unique_ptr<int[],std::default_delete<int[]>> ua1;
unique_ptr<int[],std::default_delete<int[]>>::Ctor(& ua1,tmp_9);
tmp_10 = operator[]((struct unique_ptr<int[],std::default_delete<int[]>> const *)(& ua1),
(unsigned int)0);
(size_t)0);
*tmp_10 = 4;
tmp_11 = operator[]((struct unique_ptr<int[],std::default_delete<int[]>> const *)(& ua1),
(unsigned int)1);
(size_t)1);
int z = *tmp_11;
tmp_12 = forward<std::unique_ptr<int[],std::default_delete<int[]>>>(& ua1);
tmp_13 = operator=(& ua,tmp_12);
......
......@@ -650,7 +650,7 @@ void swap<double>(double *a, double *b)
requires \valid(a); */
void swap<int,2>(int (*a)[2], int (*b)[2])
{
size_t i = (unsigned int)0;
size_t i = (size_t)0;
while (i < 2U) {
swap<int>(& (*a)[i],& (*b)[i]);
i ++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment