From e346f0da710591690fc6b94f921fb5a39a11c7bf Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Wed, 21 Sep 2016 16:07:22 +0200 Subject: Make unnamed default + correct empty struct warning. Bug 18004 --- cparser/Cerrors.ml | 1 + cparser/Elab.ml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'cparser') diff --git a/cparser/Cerrors.ml b/cparser/Cerrors.ml index f95188e8..dc0258a5 100644 --- a/cparser/Cerrors.ml +++ b/cparser/Cerrors.ml @@ -70,6 +70,7 @@ type warning_type = | CompCert_conformance let active_warnings: warning_type list ref = ref [ + Unnamed; Unknown_attribute; Celeven_extension; Gnu_empty_struct; diff --git a/cparser/Elab.ml b/cparser/Elab.ml index f82ae176..b6418217 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -843,9 +843,9 @@ and elab_struct_or_union_info keep_ty kind loc env members attrs = (* Warn for empty structs or unions *) if m = [] then if kind = Struct then begin - warning loc Celeven_extension "anonymous structs are a C11 extension" + warning loc Gnu_empty_struct "empty struct is a GNU extension" end else begin - fatal_error loc "anonymous unions are a C11 extension" + fatal_error loc "empty union is a GNU extension" end; (composite_info_def env' kind attrs m, env') -- cgit