aboutsummaryrefslogtreecommitdiffstats
path: root/cparser/Elab.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2016-11-22 17:36:41 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2016-11-22 17:36:41 +0100
commitc2ec127c0ae164d09d5952131dfaea9596e2c61d (patch)
tree10cd8bba0ff378b00db5c2249086fd09f02913e1 /cparser/Elab.ml
parent252a3b44b1cda99344a7554d1d770cabc47a3102 (diff)
downloadcompcert-kvx-c2ec127c0ae164d09d5952131dfaea9596e2c61d.tar.gz
compcert-kvx-c2ec127c0ae164d09d5952131dfaea9596e2c61d.zip
Warning for decls without name in composites.
The warning missing declarations is now also triggered for declarations without name in field lists of composite types if the declaration is not an anonymous composite or a bitfield member.
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r--cparser/Elab.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml
index 38ef7617..6188b482 100644
--- a/cparser/Elab.ml
+++ b/cparser/Elab.ml
@@ -759,7 +759,7 @@ and elab_field_group keep_ty env (Field_group (spec, fieldlist, loc)) =
let fieldlist = List.map (
function
- | (None, x) -> (Name ("", JUSTBASE, [], cabslu), x)
+ | (None, x) -> (Name ("", JUSTBASE, [], loc), x)
| (Some n, x) -> (n, x))
fieldlist
in
@@ -812,6 +812,8 @@ and elab_field_group keep_ty env (Field_group (spec, fieldlist, loc)) =
error loc "bit-field '%s' width not an integer constant" id;
None
end in
+ if id = "" && not (Cutil.is_anonymous_composite ty) && optbitsize = None then
+ warning loc Missing_declarations "declaration does not declare anything";
{ fld_name = id; fld_typ = ty; fld_bitfield = optbitsize' }
in
(List.map2 elab_bitfield fieldlist names, env')