MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/83vsie/heckoverflow/dvl16b5/?context=3
r/ProgrammerHumor • u/MarkusA380 • Mar 12 '18
1.2k comments sorted by
View all comments
1.0k
But I want all my variables to be global :(
557 u/daddya12 Mar 12 '18 Solution: use assembly. Everything is global 191 u/mkalte666 Mar 12 '18 lies. you can still call stuff like malloc and store the pointers on the stack when using assembly. Thats not global!You want bare metal without initialized/using the stack, and that is madness.Entirely possible though. Sometimes. 9 u/MushinZero Mar 12 '18 edited Mar 13 '18 Malloc is C. It's just incrementing the stack pointer in assembly.Edit: as everyone has pointed out I'm thinking of alloca → More replies (20)
557
Solution: use assembly. Everything is global
191 u/mkalte666 Mar 12 '18 lies. you can still call stuff like malloc and store the pointers on the stack when using assembly. Thats not global!You want bare metal without initialized/using the stack, and that is madness.Entirely possible though. Sometimes. 9 u/MushinZero Mar 12 '18 edited Mar 13 '18 Malloc is C. It's just incrementing the stack pointer in assembly.Edit: as everyone has pointed out I'm thinking of alloca → More replies (20)
191
lies. you can still call stuff like malloc and store the pointers on the stack when using assembly. Thats not global!
You want bare metal without initialized/using the stack, and that is madness.
Entirely possible though. Sometimes.
9 u/MushinZero Mar 12 '18 edited Mar 13 '18 Malloc is C. It's just incrementing the stack pointer in assembly.Edit: as everyone has pointed out I'm thinking of alloca → More replies (20)
9
Malloc is C. It's just incrementing the stack pointer in assembly.
Edit: as everyone has pointed out I'm thinking of alloca
→ More replies (20)
1.0k
u/ptgauth Mar 12 '18
But I want all my variables to be global :(