{"action":"opened","issue":{"url":"https://api.github.com/repos/status-im/nim-ttmath/issues/10","repository_url":"https://api.github.com/repos/status-im/nim-ttmath","labels_url":"https://api.github.com/repos/status-im/nim-ttmath/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/status-im/nim-ttmath/issues/10/comments","events_url":"https://api.github.com/repos/status-im/nim-ttmath/issues/10/events","html_url":"https://github.com/status-im/nim-ttmath/issues/10","id":310815187,"number":10,"title":"Clang cannot compile ttmath Uint in a seq","user":{"login":"mratsim","id":22738317,"avatar_url":"https://avatars3.githubusercontent.com/u/22738317?v=4","gravatar_id":"","url":"https://api.github.com/users/mratsim","html_url":"https://github.com/mratsim","followers_url":"https://api.github.com/users/mratsim/followers","following_url":"https://api.github.com/users/mratsim/following{/other_user}","gists_url":"https://api.github.com/users/mratsim/gists{/gist_id}","starred_url":"https://api.github.com/users/mratsim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mratsim/subscriptions","organizations_url":"https://api.github.com/users/mratsim/orgs","repos_url":"https://api.github.com/users/mratsim/repos","events_url":"https://api.github.com/users/mratsim/events{/privacy}","received_events_url":"https://api.github.com/users/mratsim/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-03T12:27:10Z","updated_at":"2018-04-03T12:27:10Z","closed_at":null,"author_association":"MEMBER","body":"See https://github.com/status-im/nimbus/issues/2.\r\n\r\nThis is needed for nimbus, workaround is using GCC on MacOS but probably we cant use LLVM at all for an eventual WASM target.\r\n\r\n```Nim\r\nimport ../src/ttmath\r\n\r\ntype\r\n  Stack = object\r\n    data: seq[Uint256]\r\n\r\nproc newStack(): Stack =\r\n  result.data = @[]\r\n```\r\n\r\n```\r\nttmath_stack.cpp:61:29: error: flexible array member 'data' of type 'TY_fSgjjjotfhO8wSAxXj6bfw []' with non-trivial destruction\r\n  TY_fSgjjjotfhO8wSAxXj6bfw data[SEQ_DECL_SIZE];\r\n```\r\n\r\n```C++ \r\n/* Line 60-62\r\nstruct tySequence_sp47cI5UpQ9bwXDfsT164pg : TGenericSeq {\r\n  TY_fSgjjjotfhO8wSAxXj6bfw data[SEQ_DECL_SIZE];\r\n};\r\n\r\n/* line 138-145\r\nN_LIB_PRIVATE N_NIMCALL(void, newStack_k6WSwonLTc7xJzVEEj9c9a1Q)(tyObject_Stack_9cQNCXzCX5qwQ4cPhPCufuA* Result) {\r\n\tnimfr_(\"newStack\", \"stack.nim\");\r\n\tchckNil((void*)Result);\r\n\tgenericReset((void*)Result, (&NTI_9cQNCXzCX5qwQ4cPhPCufuA_));\r\n\tnimln_(9, \"stack.nim\");\r\n\tunsureAsgnRef((void**) (&(*Result).data), (tySequence_sp47cI5UpQ9bwXDfsT164pg*) newSeq((&NTI_sp47cI5UpQ9bwXDfsT164pg_), 0));\r\n\tpopFrame();\r\n}\r\n```"}}
{"actor":{"display_login":"mratsim"}}