{"action":"created","issue":{"url":"https://api.github.com/repos/zig-lang/zig/issues/998","repository_url":"https://api.github.com/repos/zig-lang/zig","labels_url":"https://api.github.com/repos/zig-lang/zig/issues/998/labels{/name}","comments_url":"https://api.github.com/repos/zig-lang/zig/issues/998/comments","events_url":"https://api.github.com/repos/zig-lang/zig/issues/998/events","html_url":"https://github.com/zig-lang/zig/issues/998","id":321418366,"number":998,"title":"@cInclude(\"sqlite3ext.h\") generates invalid Zig","user":{"login":"bb010g","id":340132,"avatar_url":"https://avatars2.githubusercontent.com/u/340132?v=4","gravatar_id":"","url":"https://api.github.com/users/bb010g","html_url":"https://github.com/bb010g","followers_url":"https://api.github.com/users/bb010g/followers","following_url":"https://api.github.com/users/bb010g/following{/other_user}","gists_url":"https://api.github.com/users/bb010g/gists{/gist_id}","starred_url":"https://api.github.com/users/bb010g/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bb010g/subscriptions","organizations_url":"https://api.github.com/users/bb010g/orgs","repos_url":"https://api.github.com/users/bb010g/repos","events_url":"https://api.github.com/users/bb010g/events{/privacy}","received_events_url":"https://api.github.com/users/bb010g/received_events","type":"User","site_admin":false},"labels":[{"id":244683519,"url":"https://api.github.com/repos/zig-lang/zig/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/zig-lang/zig/milestones/4","html_url":"https://github.com/zig-lang/zig/milestone/4","labels_url":"https://api.github.com/repos/zig-lang/zig/milestones/4/labels","id":2505124,"number":4,"title":"0.3.0","description":"Accept and resolve these issues, reject, or postpone them before releasing 0.3.0.","creator":{"login":"andrewrk","id":106511,"avatar_url":"https://avatars0.githubusercontent.com/u/106511?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewrk","html_url":"https://github.com/andrewrk","followers_url":"https://api.github.com/users/andrewrk/followers","following_url":"https://api.github.com/users/andrewrk/following{/other_user}","gists_url":"https://api.github.com/users/andrewrk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewrk/subscriptions","organizations_url":"https://api.github.com/users/andrewrk/orgs","repos_url":"https://api.github.com/users/andrewrk/repos","events_url":"https://api.github.com/users/andrewrk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewrk/received_events","type":"User","site_admin":false},"open_issues":92,"closed_issues":49,"state":"open","created_at":"2017-05-07T16:17:21Z","updated_at":"2018-05-09T03:32:37Z","due_on":"2018-09-17T07:00:00Z","closed_at":null},"comments":2,"created_at":"2018-05-09T03:30:42Z","updated_at":"2018-05-09T16:28:08Z","closed_at":null,"author_association":"NONE","body":"Given a `test.zig` of\r\n```zig\r\nconst c = @cImport({\r\n    @cInclude(\"sqlite3ext.h\");\r\n});\r\n\r\npub fn main() void {\r\n    c.sqlite3_libversion();\r\n}\r\n```\r\nthis error is produced on master:\r\n<details><summary><code>zig run test.zig</code></summary>\r\n\r\n```\r\n/home/bb010g/Documents/test.zig:1:11: error: compiler bug: @cImport generated invalid zig code\r\nconst c = @cImport({\r\n          ^\r\n?.c:1:1: note: redefinition of 'sqlite3_module'\r\nTODO: remember C source location to display here\r\n^\r\n?.c:1:1: note: previous definition is here\r\nTODO: remember C source location to display here\r\n^\r\n/home/bb010g/Documents/test.zig:1:11: error: compiler bug: @cImport generated invalid zig code\r\nconst c = @cImport({\r\n          ^\r\n?.c:1:1: note: redefinition of 'sqlite3_module'\r\nTODO: remember C source location to display here\r\n^\r\n?.c:1:1: note: previous definition is here\r\nTODO: remember C source location to display here\r\n^\r\n/home/bb010g/Documents/test.zig:1:11: error: compiler bug: @cImport generated invalid zig code\r\nconst c = @cImport({\r\n          ^\r\n?.c:1:1: note: redefinition of 'sqlite3_vfs'\r\nTODO: remember C source location to display here\r\n^\r\n?.c:1:1: note: previous definition is here\r\nTODO: remember C source location to display here\r\n^\r\n/home/bb010g/Documents/test.zig:1:11: error: compiler bug: @cImport generated invalid zig code\r\nconst c = @cImport({\r\n          ^\r\n?.c:1:1: note: redefinition of 'sqlite3_vfs'\r\nTODO: remember C source location to display here\r\n^\r\n?.c:1:1: note: previous definition is here\r\nTODO: remember C source location to display here\r\n^\r\n```\r\n\r\n</details>"},"comment":{"url":"https://api.github.com/repos/zig-lang/zig/issues/comments/387797136","html_url":"https://github.com/zig-lang/zig/issues/998#issuecomment-387797136","issue_url":"https://api.github.com/repos/zig-lang/zig/issues/998","id":387797136,"user":{"login":"andrewrk","id":106511,"avatar_url":"https://avatars0.githubusercontent.com/u/106511?v=4","gravatar_id":"","url":"https://api.github.com/users/andrewrk","html_url":"https://github.com/andrewrk","followers_url":"https://api.github.com/users/andrewrk/followers","following_url":"https://api.github.com/users/andrewrk/following{/other_user}","gists_url":"https://api.github.com/users/andrewrk/gists{/gist_id}","starred_url":"https://api.github.com/users/andrewrk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andrewrk/subscriptions","organizations_url":"https://api.github.com/users/andrewrk/orgs","repos_url":"https://api.github.com/users/andrewrk/repos","events_url":"https://api.github.com/users/andrewrk/events{/privacy}","received_events_url":"https://api.github.com/users/andrewrk/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T16:28:08Z","updated_at":"2018-05-09T16:28:08Z","author_association":"OWNER","body":"The invalid zig generated was:\r\n\r\n```zig\r\npub const sqlite3_module = struct_sqlite3_module;\r\npub const sqlite3_module = struct_sqlite3_module;\r\n```\r\n\r\nThe rest looks good. I'm pretty sure this is some simple thing where translate-c forgot to check a  hash table before emitting a macro, or something like that. Will look into it more later."}}
{"actor":{"display_login":"andrewrk"}}