{"action":"created","issue":{"url":"https://api.github.com/repos/AbsInt/CompCert/issues/29","labels_url":"https://api.github.com/repos/AbsInt/CompCert/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/AbsInt/CompCert/issues/29/comments","events_url":"https://api.github.com/repos/AbsInt/CompCert/issues/29/events","html_url":"https://github.com/AbsInt/CompCert/issues/29","id":63023658,"number":29,"title":"Struct return transformation: function declaration","user":{"login":"mbbarbosa","id":5985234,"avatar_url":"https://avatars.githubusercontent.com/u/5985234?v=3","gravatar_id":"","url":"https://api.github.com/users/mbbarbosa","html_url":"https://github.com/mbbarbosa","followers_url":"https://api.github.com/users/mbbarbosa/followers","following_url":"https://api.github.com/users/mbbarbosa/following{/other_user}","gists_url":"https://api.github.com/users/mbbarbosa/gists{/gist_id}","starred_url":"https://api.github.com/users/mbbarbosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbbarbosa/subscriptions","organizations_url":"https://api.github.com/users/mbbarbosa/orgs","repos_url":"https://api.github.com/users/mbbarbosa/repos","events_url":"https://api.github.com/users/mbbarbosa/events{/privacy}","received_events_url":"https://api.github.com/users/mbbarbosa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-19T15:54:41Z","updated_at":"2015-03-20T21:26:01Z","closed_at":null,"body":"The code in lines 52-59 of cparser/StructReturn.ml does not seem to correctly re-write function declarations of the form\r\n\r\n`struct a func(void);`\r\n\r\nThe re-written output is:\r\n\r\n`extern void f(void);`\r\n\r\nWhen I guess it should be:\r\n\r\n`extern void f(struct a *);`\r\n"},"comment":{"url":"https://api.github.com/repos/AbsInt/CompCert/issues/comments/84153047","html_url":"https://github.com/AbsInt/CompCert/issues/29#issuecomment-84153047","issue_url":"https://api.github.com/repos/AbsInt/CompCert/issues/29","id":84153047,"user":{"login":"mbbarbosa","id":5985234,"avatar_url":"https://avatars.githubusercontent.com/u/5985234?v=3","gravatar_id":"","url":"https://api.github.com/users/mbbarbosa","html_url":"https://github.com/mbbarbosa","followers_url":"https://api.github.com/users/mbbarbosa/followers","following_url":"https://api.github.com/users/mbbarbosa/following{/other_user}","gists_url":"https://api.github.com/users/mbbarbosa/gists{/gist_id}","starred_url":"https://api.github.com/users/mbbarbosa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbbarbosa/subscriptions","organizations_url":"https://api.github.com/users/mbbarbosa/orgs","repos_url":"https://api.github.com/users/mbbarbosa/repos","events_url":"https://api.github.com/users/mbbarbosa/events{/privacy}","received_events_url":"https://api.github.com/users/mbbarbosa/received_events","type":"User","site_admin":false},"created_at":"2015-03-20T21:26:01Z","updated_at":"2015-03-20T21:26:01Z","body":"To clarify, I add my input program:\r\n\r\n```\r\nstruct foo {\r\n   int afield[10];\r\n};\r\n\r\nstruct foo afunction();\r\n\r\nint anotherf() {\r\n   struct foo var = afunction();\r\n   return var.afield[0];\r\n} \r\n```\r\n\r\nAnd an excerpt of the .compcert.c file.\r\n\r\n```\r\nstruct foo;\r\nstruct foo {\r\n  int afield[10];\r\n};\r\n\r\nextern void afunction(void);\r\n\r\nint anotherf(void)\r\n{\r\n  struct foo var;\r\n  afunction(&var);\r\n  return *(var.afield + 0);\r\n} \r\n```\r\n"}}