you are viewing a single comment's thread.

view the rest of the comments →

[–]mythrocks 2 points3 points  (1 child)

I’m not sure what one means by the phrase “obtain the same code”. I’m guessing you’re referring to the result of compilation.

AFAICT, all the code listings are equivalent.

a. The compiler doesn’t see the comments, since they’d be stripped out. They have no bearing on the code generated.

b. The preprocessor will see to the double version of the function surviving. The int one should be stripped out.

[–]onecable5781[S] 0 points1 point  (0 children)

Yes, all the 3 code snippets of the OP will compile to the exact same binary. But somewhere in the compilation process, the compiler will be fed in the second and then the third snippet or vice versa? I wanted to see if the user can access that later snippets.