summaryrefslogtreecommitdiff
path: root/cparser
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-13 14:26:38 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-05-13 14:26:38 +0000
commit20816515fc6c3512b15f39fbc4ec4822b0b53043 (patch)
tree0bd22c2e28d9ee199db6af57f66ff886ae5ebdec /cparser
parent054ce39caf060408f6555bcd0b6d90b5bf4c00c5 (diff)
Support __attribute__(ident) where ident is not bound. Useful for GCC compatibility in general and MacOS 10.8 standard includes in particular.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2248 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser')
-rw-r--r--cparser/Elab.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index 28170a6..2e0c49f 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -254,9 +254,12 @@ exception Wrong_attr_arg
let elab_attr_arg loc env a =
match a with
| VARIABLE s ->
- begin match wrap Env.lookup_ident loc env s with
- | (id, II_ident(sto, ty)) -> AIdent s
- | (id, II_enum v) -> AInt v
+ begin try
+ match Env.lookup_ident env s with
+ | (id, II_ident(sto, ty)) -> AIdent s
+ | (id, II_enum v) -> AInt v
+ with Env.Error _ ->
+ AIdent s
end
| _ ->
let b = !elab_expr_f loc env a in