Silence empty struct warning

Last but not least, -Wpedantic warns about empty structs.  With this,
-Wpedantic build is now clean of warnings on gcc 5.4.0 and clang 4.0.
This commit is contained in:
David Lamparter 2017-05-19 09:44:09 +02:00
parent b0810da2c3
commit aa1f31d401
2 changed files with 10 additions and 8 deletions

View file

@ -960,7 +960,9 @@ static void define_struct(struct node *n) {
str_add(&HDR, s.enums.str, s.enums.len);
str_addf(&HDR, "\nstruct %s {\n", n->name.str);
str_addf(&HDR, "\n%sstruct %s {\n",
s.decl.len == 0 ? "capnp_nowarn " : "",
n->name.str);
str_add(&HDR, s.decl.str, s.decl.len);
str_addf(&HDR, "};\n");