Forbid incompatible pointer conversion

This commit is contained in:
Minseong Jang
2022-04-04 20:26:54 +09:00
parent 5f5fef54bd
commit 3a36e47985
3 changed files with 2 additions and 3 deletions

View File

@@ -811,9 +811,6 @@ mod calculator {
(Value::Float { value, .. }, Dtype::Float { width, .. }) => {
Ok(Value::float(value.into_inner(), width))
}
(Value::Pointer { bid, offset, .. }, Dtype::Pointer { inner, .. }) => {
Ok(Value::pointer(bid, offset, inner.deref().clone()))
}
(value, dtype) => todo!("calculate_typecast ({:?}) {:?}", value, dtype),
}
}

View File

@@ -38,6 +38,7 @@ REPLACE_DICT = {
"_Nullable": "",
"\"g_\w*\", ": "", # transparent_crc에서 프린트 목적으로 받은 StringLiteral 삭제
"char\* vname, ": "", # transparent_crc에서 사용하지 않는 파라미터 삭제
r"transparent_crc_bytes\s*\([^;]*\);": "", # transparent_crc_bytes 삭제
r"[^\n]*_IO_2_1_[^;]*;": "", # extern을 지우면서 생긴 size를 알 수 없는 struct 삭제
r"__asm\s*\([^\)]*\)": "", # asm extension in mac
r"__asm__\s*\([^\)]*\)": "", # asm extension in linux

View File

@@ -47,6 +47,7 @@ if
grep 'no semicolon at end' outa.txt ||\
grep 'type defaults to' outa.txt ||\
grep 'too few arguments for format' outa.txt ||\
grep 'incompatible pointer' out_gcc.txt ||\
grep 'ordered comparison of pointer with integer' outa.txt ||\
grep 'declaration does not declare anything' outa.txt ||\
grep 'expects type' outa.txt ||\