5 ms·
With C there is the ABI which is platform specific but can't change without all hell breaking loose. Also after twenty terrible years for profilers frame point
by Gibbon1 2y ago
With C there is the ABI which is platform specific but can't change without all hell breaking loose. Also after twenty terrible years for profilers frame pointer are returning.
So the ABI allows you to do this sort of stuff reliably as long as the compiler isn't doing inane things with UB.
- gpderetta 2y agoThe ABI doesn't mandate were locals are located on a stack frame thought so I'm not sure how would you inspect those. If you simply meant that you want rely on an ABI, then that's fine, although relying on those details might be UB for standard conforming code, it is obviously well defined for compilers that conform to the ABI. Just because it is undefined from a standard point of view, doesn't mean is still undefined for a specific compiler + platform. You will still need to use compilation firewalls and barriers to avoid aliasing or pointer provenance issues of course.