aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Elab.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2018-04-05 15:11:56 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2018-04-05 15:11:56 +0200
commit777e6204ef99436cb315e7c914709e4a334f0066 (patch)
tree4ca5e784851a1ad62b113571f055da40e2f794d5 /cparser/Elab.ml
parentadbefdc338c921f1b05dcf4996d32a3ca8b5f486 (diff)
downloadcompcert-kvx-777e6204ef99436cb315e7c914709e4a334f0066.tar.gz
compcert-kvx-777e6204ef99436cb315e7c914709e4a334f0066.zip
Error for subtraction arithmetic type - pointer type (#73)
Substraction is only allowed for pointer - pointer, pointer - arithmetic or arithmetic - arithmetic. This also leads to a retyping error later. Bug 23357
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r--cparser/Elab.ml3
1 files changed, 0 insertions, 3 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index a1f85886..0b83a97d 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -1819,9 +1819,6 @@ let elab_expr vararg loc env a =
if not (wrap pointer_arithmetic_ok loc env ty) then
err "illegal pointer arithmetic in binary '-'";
(TPtr(ty, []), TPtr(ty, []))
- | (TInt _ | TEnum _), (TPtr(ty, a) | TArray(ty, _, a)) ->
- check_ptr_arith env ty '-';
- (TPtr(ty, []), TPtr(ty, []))
| (TPtr(ty1, a1) | TArray(ty1, _, a1)),
(TPtr(ty2, a2) | TArray(ty2, _, a2)) ->
if not (compatible_types AttrIgnoreAll env ty1 ty2) then