News for hackers. Stuff that matters.
Re:The Resurgence of C Programming by bogomipz on Tuesday December 27, 2016 @06:58PM (#13267368)
This is an interesting read, thanks. However I do not understand the opening sentence:

"Pointers in the C language are more abstract than pointers in the hardware, and the compiler may surprise developers that think that pointers in C work in the same way as pointers in the CPU."

What are pointers in the hardware? I am not sure what is being said. Any ideas?

Re:The Resurgence of C Programming by cesarb on Tuesday December 27, 2016 @07:18PM (#13267467)
> What are pointers in the hardware?

Under current "flat address space" architectures, a pointer in the hardware is nothing more than a memory address, represented as an integer. That is, a pointer with value 0x12345678 is the address of the memory 0x12345678 bytes above the start of the virtual address space.

In the C language, pointers are more abstract: they have to point to either within an object, or one past the end of an object. This is because there are architectures like segmented architectures, where a pointer has two parts (segment and offset) and cannot be treated just like an integer, and the same C program should in theory be able to also run in these architectures without change.

Re:The Resurgence of C Programming by bogomipz on Tuesday December 27, 2016 @07:56PM (#13267631)
Thanks for pointing out the alternative of segmented memory, this now makes sense. Cheers.