Skip to content

Commit cd07bb1

Browse files
committed
Ignore top level qualifiers in __builtin_types_compatible_p
1 parent e9060b8 commit cd07bb1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/frontc/cabs2cil.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4658,7 +4658,8 @@ and doExp (asconst: bool) (* This expression is used as a constant *)
46584658
prechunk := (fun _ -> empty);
46594659
piscall := false;
46604660
let compatible =
4661-
try ignore(combineTypes CombineOther t1 t2); true
4661+
(* This built-in function ignores top level qualifiers (e.g., const, volatile). *)
4662+
try ignore(combineTypes CombineOther (removeOuterQualifierAttributes t1) (removeOuterQualifierAttributes t2)); true
46624663
with Failure _ -> false
46634664
in
46644665
if compatible then

0 commit comments

Comments
 (0)