|
|
Subscribe / Log in / New account

Function Pointer cast

Function Pointer cast

Posted Feb 8, 2024 6:50 UTC (Thu) by mb (subscriber, #50428)
In reply to: Function Pointer cast by milesrout
Parent article: Defining the Rust 2024 edition

> dereferencing an invalid pointer. It's possible to define it perfectly well

Yes. But that probably costs you most optimization opportunities and all parts of the code.
You can have that behavior today by disabling optimization in C.
Not sure, if it's possible in Rust. Probably not. Rust is quite strict about assuming no-UB.

"Coding to the machine" and "getting what the hardware does" is impossible in real programs.


to post comments


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds