{"action":"created","issue":{"url":"https://api.github.com/repos/Intrepid/upc2c/issues/113","labels_url":"https://api.github.com/repos/Intrepid/upc2c/issues/113/labels{/name}","comments_url":"https://api.github.com/repos/Intrepid/upc2c/issues/113/comments","events_url":"https://api.github.com/repos/Intrepid/upc2c/issues/113/events","html_url":"https://github.com/Intrepid/upc2c/issues/113","id":109546094,"number":113,"title":"Bad translated output for attribute((transparent_union))","user":{"login":"PHHargrove","id":6687992,"avatar_url":"https://avatars.githubusercontent.com/u/6687992?v=3","gravatar_id":"","url":"https://api.github.com/users/PHHargrove","html_url":"https://github.com/PHHargrove","followers_url":"https://api.github.com/users/PHHargrove/followers","following_url":"https://api.github.com/users/PHHargrove/following{/other_user}","gists_url":"https://api.github.com/users/PHHargrove/gists{/gist_id}","starred_url":"https://api.github.com/users/PHHargrove/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PHHargrove/subscriptions","organizations_url":"https://api.github.com/users/PHHargrove/orgs","repos_url":"https://api.github.com/users/PHHargrove/repos","events_url":"https://api.github.com/users/PHHargrove/events{/privacy}","received_events_url":"https://api.github.com/users/PHHargrove/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-02T18:28:01Z","updated_at":"2015-10-06T18:20:48Z","closed_at":null,"body":"Given the following input:\r\n```C\r\ntypedef union {\r\n    int *p;\r\n    uintptr_t u;\r\n} foo_t __attribute__((transparent_union));\r\n```\r\n\r\nThe upc2c translator is emitting the following:\r\n```C\r\ntypedef union __attribute__((transparent_union)) {\r\n    int *p;\r\n    uintptr_t u;\r\n} foo_t;\r\n```\r\n\r\nNotice that the attribute has changed location.\r\nThe clang C compiler (including, but not limited to, one built from the same sources as the translator) is happy with the original form, but rejects the translated code:\r\n```\r\n$ clang -c foo.c\r\nfoo.c:3:30: warning: transparent_union attribute can only be applied to a union definition; attribute ignored\r\n      [-Wignored-attributes]\r\ntypedef union __attribute__((transparent_union)) {\r\n                             ^\r\n1 warning generated.\r\n```\r\n\r\nWhile this is only a warning, it means that code that requires the transparent_union property of the union may encounter additional warnings or errors.\r\n\r\n\r\nThis did not occur prior to the recent 3.6 merge. \r\n"},"comment":{"url":"https://api.github.com/repos/Intrepid/upc2c/issues/comments/145953040","html_url":"https://github.com/Intrepid/upc2c/issues/113#issuecomment-145953040","issue_url":"https://api.github.com/repos/Intrepid/upc2c/issues/113","id":145953040,"user":{"login":"swatanabe","id":82176,"avatar_url":"https://avatars.githubusercontent.com/u/82176?v=3","gravatar_id":"","url":"https://api.github.com/users/swatanabe","html_url":"https://github.com/swatanabe","followers_url":"https://api.github.com/users/swatanabe/followers","following_url":"https://api.github.com/users/swatanabe/following{/other_user}","gists_url":"https://api.github.com/users/swatanabe/gists{/gist_id}","starred_url":"https://api.github.com/users/swatanabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swatanabe/subscriptions","organizations_url":"https://api.github.com/users/swatanabe/orgs","repos_url":"https://api.github.com/users/swatanabe/repos","events_url":"https://api.github.com/users/swatanabe/events{/privacy}","received_events_url":"https://api.github.com/users/swatanabe/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T18:20:48Z","updated_at":"2015-10-06T18:20:48Z","body":"AMDG\n\nOn 10/06/2015 11:12 AM, Nenad Vukicevic wrote:\n> Can you check if there is an upstream fix that we can use?\n> \n\n  This needs to be changed in DeclPrinter,\nunless we don't care about compatibility\nwith the official clang 3.6 release.\n\nIn Christ,\nSteven Watanabe\n\n"}}