diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-13 14:26:38 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-05-13 14:26:38 +0000 |
commit | 20816515fc6c3512b15f39fbc4ec4822b0b53043 (patch) | |
tree | 0bd22c2e28d9ee199db6af57f66ff886ae5ebdec /cparser/Elab.ml | |
parent | 054ce39caf060408f6555bcd0b6d90b5bf4c00c5 (diff) | |
download | compcert-20816515fc6c3512b15f39fbc4ec4822b0b53043.tar.gz compcert-20816515fc6c3512b15f39fbc4ec4822b0b53043.zip |
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/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 28170a62..2e0c49fd 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 |