From e248bbeb6ae319e79715126d18569c2bd856cc75 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 28 Dec 2013 09:35:59 +0000 Subject: Removed obsolete check on aligned fields. More informative "unsupported" error messages. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2387 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- cfrontend/C2C.ml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cfrontend') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index 4cac92c..45ff80f 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -265,9 +265,8 @@ let convertTyp env t = | C.TArray(ty, Some sz, a) -> Tarray(convertTyp seen ty, convertInt sz, convertAttr a) | C.TFun(tres, targs, va, a) -> - (* if va then unsupported "variadic function type"; *) if Cutil.is_composite_type env tres then - unsupported "return type is a struct or union"; + unsupported "return type is a struct or union (consider adding option -fstruct-return)"; Tfunction(begin match targs with | None -> (*warning "un-prototyped function type";*) Tnil | Some tl -> convertParams seen tl @@ -561,7 +560,7 @@ let rec convertExpr env e = | C.ECall(fn, args) -> if not (supported_return_type env e.etyp) then - unsupported ("function returning a result of type " ^ string_of_type e.etyp); + unsupported ("function returning a result of type " ^ string_of_type e.etyp ^ " (consider adding option -fstruct-return)"); Ecall(convertExpr env fn, convertExprList env args, ty) and convertLvalue env e = @@ -719,7 +718,7 @@ and convertSwitch ploc env = function let convertFundef loc env fd = if Cutil.is_composite_type env fd.fd_ret then - unsupported "function returning a struct or union"; + unsupported "function returning a struct or union (consider adding option -fstruct-return)"; let ret = convertTyp env fd.fd_ret in let params = @@ -837,10 +836,7 @@ let convertGlobvar loc env (sto, id, ty, optinit) = let checkComposite env si id attr flds = let checkField f = if f.fld_bitfield <> None then - unsupported "bit field in struct or union"; - if Cutil.find_custom_attributes ["aligned"; "__aligned__"] - (Cutil.attributes_of_type env f.fld_typ) <> [] then - warning ("ignoring 'aligned' attribute on field " ^ f.fld_name) + unsupported "bit field in struct or union (consider adding option -fbitfields)" in List.iter checkField flds (** Convert a list of global declarations. -- cgit v1.2.3