3 ms·
> It would be in a register. Of course. Or it would be eliminated by a compiler optimization As long as you’re taking, and using, the address of that variable,
by Const-me 6y ago
> It would be in a register. Of course. Or it would be eliminated by a compiler optimization
As long as you’re taking, and using, the address of that variable, it’s almost guaranteed to be in memory. Even if it won’t, the compiler guarantees the output of the program will be equivalent to unoptimized code.
> arguments will not be passed via the stack
I’m not sure explaining nuances of various calling conventions, and how they differ across processors and OSes, is useful information in a document about C and targeted towards beginners.
You’re talking about things which are underneath C in the abstraction layer hierarchy. The abstraction has many layers, the lowest one being quantum physics. One has to stop somewhere, and this article decided to stop at C, as opposed to assembly.
- tom_mellior 6y agoSee my reply to your sibling comment. I wasn't proposing adding more irrelevant detail. If anything, I was proposing removing the existing irrelevant and incorrect/very incomplete detail.
- thrwaeasddsaf 6y ago> One has to stop somewhere, and this article decided to stop at C, as opposed to assembly. As soon as you mention the stack, you've gone beyond C and started talking about something that is not C.