aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-09-21 10:11:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2018-09-21 10:11:37 +0000
commit518196cb3fce647789ff4c9f4679bb7087030158 (patch)
tree3608fccf597850b0bfea6bd4794ada2f8abe8866 /gcc/c-family
parentd5d94b80c320319263b0bba3083f8bc80bf6ef4b (diff)
downloadgcc-518196cb3fce647789ff4c9f4679bb7087030158.zip
gcc-518196cb3fce647789ff4c9f4679bb7087030158.tar.gz
gcc-518196cb3fce647789ff4c9f4679bb7087030158.tar.bz2
c-ada-spec.c: Include diagnostic.h.
* c-ada-spec.c: Include diagnostic.h. (dump_ada_declaration) <RECORD_TYPE>: Issue a warning on packed layout. From-SVN: r264466
Diffstat (limited to 'gcc/c-family')
-rw-r--r--gcc/c-family/ChangeLog5
-rw-r--r--gcc/c-family/c-ada-spec.c11
2 files changed, 16 insertions, 0 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index 8fc773c..4080bee 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c: Include diagnostic.h.
+ (dump_ada_declaration) <RECORD_TYPE>: Issue a warning on packed layout.
+
2018-09-19 Marek Polacek <polacek@redhat.com>
* c.opt (Wclass-conversion): New.
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index 5e0dea4..eae741e 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -27,6 +27,7 @@ along with GCC; see the file COPYING3. If not see
#include "c-ada-spec.h"
#include "fold-const.h"
#include "c-pragma.h"
+#include "diagnostic.h"
#include "stringpool.h"
#include "attribs.h"
@@ -2700,6 +2701,16 @@ dump_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
return 1;
}
+ /* ??? Packed record layout is not supported. */
+ if (TYPE_PACKED (TREE_TYPE (t)))
+ {
+ warning_at (DECL_SOURCE_LOCATION (t), 0,
+ "unsupported record layout");
+ pp_string (buffer, "pragma Compile_Time_Warning (True, ");
+ pp_string (buffer, "\"probably incorrect record layout\");");
+ newline_and_indent (buffer, spc);
+ }
+
if (orig && TYPE_NAME (orig))
pp_string (buffer, "subtype ");
else