From f26f2622e5a536bec61fbb0244dabdc796711bd6 Mon Sep 17 00:00:00 2001 From: Virgile Prevosto <virgile.prevosto@m4x.org> Date: Tue, 19 Mar 2019 10:30:31 +0100 Subject: [PATCH] check non-interference of __anonCompField1 with anonymous field --- tests/syntax/oracle/rename.res.oracle | 9 +++++++++ tests/syntax/rename.i | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/tests/syntax/oracle/rename.res.oracle b/tests/syntax/oracle/rename.res.oracle index 1397bafc86b..52e6869da08 100644 --- a/tests/syntax/oracle/rename.res.oracle +++ b/tests/syntax/oracle/rename.res.oracle @@ -1,8 +1,16 @@ [kernel] Parsing tests/syntax/rename.i (no preprocessing) +[kernel] tests/syntax/rename.i:48: Warning: + unnamed fields are a C11 extension (use -c11 to avoid this warning) /* Generated by Frama-C */ struct not_anon { int __anonCompField1 ; }; +struct __anonstruct_1 { + int inner_i ; +}; +struct anon { + struct __anonstruct_1 __anonCompField1 ; +}; int f(void) { int x = 0; @@ -66,4 +74,5 @@ void f4(int *j_0_1) } struct not_anon s = {.__anonCompField1 = 0}; +struct anon a = {.__anonCompField1 = {.inner_i = 0}}; diff --git a/tests/syntax/rename.i b/tests/syntax/rename.i index 201ece88971..08a549ccc24 100644 --- a/tests/syntax/rename.i +++ b/tests/syntax/rename.i @@ -44,3 +44,9 @@ struct not_anon { }; struct not_anon s = {.__anonCompField1 = 0}; + +struct anon { + struct { int inner_i; }; +}; + +struct anon a = { .inner_i = 0 }; -- GitLab