Commit 518196cb by Eric Botcazou Committed by Eric Botcazou

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
parent d5d94b80
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.
......
......@@ -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
......
2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/dump-ada-spec-14.c: New test.
2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-11.c: New test.
* lib/target-supports.exp (check_effective_target_tls_runtime): Make
......
/* { dg-do compile } */
/* { dg-options "-fdump-ada-spec" } */
struct __attribute__((packed)) S /* { dg-warning "unsupported record layout" } */
{
char c;
int t;
};
/* { dg-final { cleanup-ada-spec } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment