r/programming • • May 01 '18

C Is Not a Low-level Language - ACM Queue

https://queue.acm.org/detail.cfm?id=3212479
152 Upvotes

303 comments sorted by

View all comments

Show parent comments

2

u/Poddster May 02 '18

due to it's ability to manipulate absolute pointers

C can't manipulate absolute pointers. e.g. 6.5.6.9 -- you can't perform arithmetic on two pointers that don't already point to the same allocation. And then when you are subtracting you have to ensure you can fit the result in a ptrdiff_t etc etc etc.

Hell, you can't even MAKE a pointer to a non-allocated address in C, regardless of whether you dereference it or not.

Non of these rules or restrictions exist on the CPU.

0

u/tonefart May 02 '18

That restriction is OS, not language. During the dos days, you can pretty much create a pointer at ANY location you wish. That's how video memory in graphics/text mode was accessed for fast text-ui library and vga graphics. You also make trainers/cheats to modify memory location that isn't allocated by your own program, for cracking purposes in memory.

1

u/Poddster May 03 '18

That restriction is OS, not language.

Those restrictions are literally in the spec.