summaryrefslogtreecommitdiff
path: root/cfrontend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-28 09:35:59 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-28 09:35:59 +0000
commite248bbeb6ae319e79715126d18569c2bd856cc75 (patch)
treec346af8881613f44ecf421eee45953c0e638c395 /cfrontend
parent8d7c806e16b98781a3762b5680b4dc64764da1b8 (diff)
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
Diffstat (limited to 'cfrontend')
-rw-r--r--cfrontend/C2C.ml12
1 files changed, 4 insertions, 8 deletions
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.