Re:How I Built Zig-SQLite
by cryptonector on Friday May 27, 2022 @05:48PM
(#31535331)
No, really, the C language makes no assumptions about this.
[ Parent
| on HN ]
You can't take an address of pretty much any input parameter, return value, or local variable of a function on a stack machine because they're all on the stack CPU core's hardware data stack which has no addresses for its elements. In C you should be able to take the address of these objects, using an ampersand. That's not making an assumption?
Re:How I Built Zig-SQLite
by cryptonector on Friday May 27, 2022 @10:46PM
(#31537167)
If it's addressable memory, you can address it. That does not assume a stack however. You don't get to assume that they are in some order, not if you want your code to be portable. On typical architectures that do use a stack, if you're very careful, you do get to use the addresses of automatics to figure out whether the stack grows up or down, but that's not specifically something in standard C.