Why does a call to a pointer to member function handle virtual functions even if the class has no virtual methods?
https://godbolt.org/z/W8b3TG5f6
Make compilers not compile indirect calls
I have the following hashmap:
Why is the assembly code generated with gcc under windows unable to be assembled under WSL?
I learned that assembly code doesn’t depend on the OS. For verification, I generate the assembly code of the following code snippet (named test.c
) under windows and try assembling it under WSL.
Why are objects that are passed by value not allocated on the callee’s stack frame?
When passing an object Bar as a value to a function foo(), I noticed that the compiler (gcc) would construct a copy of the object outside of foo’s stack frame and then pass the newly constructed object’s reference to foo(). This behavior seems counter intuitive, what’s the reason for it?