From 20816515fc6c3512b15f39fbc4ec4822b0b53043 Mon Sep 17 00:00:00 2001 From: xleroy Date: Mon, 13 May 2013 14:26:38 +0000 Subject: 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 --- cparser/Elab.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'cparser') 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 -- cgit v1.2.3