compiler-explorer

Step into standard library call with godbolt

ε祈祈猫儿з 提交于 2021-01-26 07:40:35
问题 I want to know how various compilers implement std::random_device , so I popped it into godbolt. Unfortunately, the only thing it says is std::random_device::operator()(): push rbp mov rbp, rsp sub rsp, 16 mov QWORD PTR [rbp-8], rdi mov rax, QWORD PTR [rbp-8] mov rdi, rax call std::random_device::_M_getval() leave ret which is not very helpful. How can I step into the _M_getval() call and examine the assembly there? 回答1: You can't "step into" functions; Godbolt isn't a debugger, it's a

Why is Visual Studio on Compiler Explorer ignoring the Exception Model setting?

允我心安 提交于 2020-01-14 10:23:39
问题 When I try to use the /EHs flag in a Compiler Explorer testcase (to "enable" exceptions passing through extern "C" functions), VC++ 19.22 seems to be ignoring it, based on it still kicking out a C5039 and not actually changing the code. What am I missing? Have I forgotten another switch or something? Base case cmdline: /O1 /EHsc /Wall /wd4571 Test case cmdline: /O1 /EHs /Wall /wd4571 回答1: Ah, looks like Compiler Explorer sets the exception model itself, and this is taking precedence. 来源:

Why is Visual Studio on Compiler Explorer ignoring the Exception Model setting?

孤街浪徒 提交于 2020-01-14 10:23:32
问题 When I try to use the /EHs flag in a Compiler Explorer testcase (to "enable" exceptions passing through extern "C" functions), VC++ 19.22 seems to be ignoring it, based on it still kicking out a C5039 and not actually changing the code. What am I missing? Have I forgotten another switch or something? Base case cmdline: /O1 /EHsc /Wall /wd4571 Test case cmdline: /O1 /EHs /Wall /wd4571 回答1: Ah, looks like Compiler Explorer sets the exception model itself, and this is taking precedence. 来源: