From edc0d97de02a0155c608c1c62daa246616e41c1c Mon Sep 17 00:00:00 2001 From: Jonah Beckford <9566106-jonahbeckford@users.noreply.gitlab.com> Date: Tue, 26 Sep 2023 20:13:27 -0700 Subject: [PATCH] bugfix: Remove attribute from struct types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC does not support some attributes on types: > warning: ‘visibility’ attribute ignored on types --- compiler/capnpc-c.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/capnpc-c.c b/compiler/capnpc-c.c index 9926d12..747ae2a 100644 --- a/compiler/capnpc-c.c +++ b/compiler/capnpc-c.c @@ -1126,9 +1126,8 @@ static void define_struct(struct node *n, const char* extattr, const char* extat str_add(&HDR, s.enums.str, s.enums.len); - str_addf(&HDR, "\n%sstruct %s%s%s {\n", + str_addf(&HDR, "\n%sstruct %s {\n", s.decl.len == 0 ? "capnp_nowarn " : "", - extattr, extattr_space, n->name.str); str_add(&HDR, s.decl.str, s.decl.len); str_addf(&HDR, "};\n"); @@ -1662,7 +1661,7 @@ int main() { str_addf(&HDR, "\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n"); - declare_ext(file_node, "struct %s%s%s;\n", 1, extattr, extattr_space); + declare(file_node, "struct %s;\n", 1); declare(file_node, "typedef struct {capn_ptr p;} %s_ptr;\n", 1); declare(file_node, "typedef struct {capn_ptr p;} %s_list;\n", 1);