{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla/rr/issues/1666","repository_url":"https://api.github.com/repos/mozilla/rr","labels_url":"https://api.github.com/repos/mozilla/rr/issues/1666/labels{/name}","comments_url":"https://api.github.com/repos/mozilla/rr/issues/1666/comments","events_url":"https://api.github.com/repos/mozilla/rr/issues/1666/events","html_url":"https://github.com/mozilla/rr/issues/1666","id":139036803,"number":1666,"title":"Compiler error on 32bit Linux","user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars.githubusercontent.com/u/712232?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-03-07T17:16:40Z","updated_at":"2016-03-07T17:23:50Z","closed_at":null,"body":"GCC 5.3.0 gives the following error on 32bit ArchLinux.\r\n\r\n```\r\n[ 59%] Building CXX object CMakeFiles/rr.dir/src/record_syscall.cc.o\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/record_syscall.cc: In function ‘Switchable prepare_ioctl(Task*, TaskSyscallState&)’:\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/record_syscall.cc:1129:49: error: call of overloaded ‘HEX(long unsigned int&)’ is ambiguous\r\n   LOG(debug) << \"handling ioctl(\" << HEX(request) << \"): type:\" << HEX(type)\r\n                                                 ^\r\nIn file included from /home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/record_syscall.cc:63:0:\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/log.h:178:14: note: candidate: void* HEX(uint64_t)\r\n inline void* HEX(uint64_t v) { return reinterpret_cast<void*>(v); }\r\n              ^\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/log.h:179:14: note: candidate: void* HEX(int64_t)\r\n inline void* HEX(int64_t v) { return reinterpret_cast<void*>(v); }\r\n              ^\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/log.h:180:14: note: candidate: void* HEX(uint32_t)\r\n inline void* HEX(uint32_t v) { return reinterpret_cast<void*>(v); }\r\n              ^\r\n/home/yuyichao/projects/archcn/repo/rr-git/src/rr/src/log.h:181:14: note: candidate: void* HEX(int32_t)\r\n inline void* HEX(int32_t v) { return reinterpret_cast<void*>(uint32_t(v)); }\r\n              ^\r\nCMakeFiles/rr.dir/build.make:846: recipe for target 'CMakeFiles/rr.dir/src/record_syscall.cc.o' failed\r\nmake[2]: *** [CMakeFiles/rr.dir/src/record_syscall.cc.o] Error 1\r\nCMakeFiles/Makefile2:7523: recipe for target 'CMakeFiles/rr.dir/all' failed\r\nmake[1]: *** [CMakeFiles/rr.dir/all] Error 2\r\nMakefile:160: recipe for target 'all' failed\r\nmake: *** [all] Error 2\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/mozilla/rr/issues/comments/193357935","html_url":"https://github.com/mozilla/rr/issues/1666#issuecomment-193357935","issue_url":"https://api.github.com/repos/mozilla/rr/issues/1666","id":193357935,"user":{"login":"yuyichao","id":712232,"avatar_url":"https://avatars.githubusercontent.com/u/712232?v=3","gravatar_id":"","url":"https://api.github.com/users/yuyichao","html_url":"https://github.com/yuyichao","followers_url":"https://api.github.com/users/yuyichao/followers","following_url":"https://api.github.com/users/yuyichao/following{/other_user}","gists_url":"https://api.github.com/users/yuyichao/gists{/gist_id}","starred_url":"https://api.github.com/users/yuyichao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yuyichao/subscriptions","organizations_url":"https://api.github.com/users/yuyichao/orgs","repos_url":"https://api.github.com/users/yuyichao/repos","events_url":"https://api.github.com/users/yuyichao/events{/privacy}","received_events_url":"https://api.github.com/users/yuyichao/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T17:23:50Z","updated_at":"2016-03-07T17:23:50Z","body":"There also seems to be a typo in `src/task.cc` for 32bit in https://github.com/mozilla/rr/commit/008817571cd925a03c11d9de3fef7e93f21dc093? The following patch fix compilation for me after replacing the `HEX(request)` with `(void*)(request)`. I could submit a PR but I don't really understand why `HEX(request)` doesn't work......\r\n\r\n```diff\r\ndiff --git a/src/task.cc b/src/task.cc\r\nindex 7317d05..6da1237 100644\r\n--- a/src/task.cc\r\n+++ b/src/task.cc\r\n@@ -1331,7 +1331,7 @@ const ExtraRegisters& Task::extra_regs() {\r\n \r\n       extra_registers.format_ = ExtraRegisters::XSAVE;\r\n       extra_registers.data_.resize(sizeof(user_fpxregs_struct));\r\n-      xptrace(PTRACE_GETFPXREGS, nullptr, extra_registers.data_.data_());\r\n+      xptrace(PTRACE_GETFPXREGS, nullptr, extra_registers.data_.data());\r\n #elif defined(__x86_64__)\r\n       // x86-64 that doesn't support XSAVE; apparently Xeon E5620 (Westmere)\r\n       // is in this class.\r\n@@ -1571,7 +1571,7 @@ void Task::set_extra_regs(const ExtraRegisters& regs) {\r\n       } else {\r\n #if defined(__i386__)\r\n         ptrace_if_alive(PTRACE_SETFPXREGS, nullptr,\r\n-                        extra_registers.data_.data_());\r\n+                        extra_registers.data_.data());\r\n #elif defined(__x86_64__)\r\n         ptrace_if_alive(PTRACE_SETFPREGS, nullptr,\r\n                         extra_registers.data_.data());\r\n```\r\n"}}