External functions are assumed to be unsafe (https://doc.rust-lang.org/reference/items/external-blocks.html#r-items.extern.fn.safety) but there should be an option to mark one as safe
For example, for FFI bindings for the PHP source, the function zend_html_putc (https://github.com/php/php-src/blob/d03163dc0af54f9c0687ab345f5db2584563b2a7/Zend/zend_highlight.c#L28) is always going to be safe - it just prints a character. Similarly, zend_gdb_present (https://github.com/php/php-src/blob/PHP-8.5.10/Zend/zend_gdb.c#L110) takes no parameters and returns a boolean reporting if GDB is present - this function is always going to be safe to call
There should be a way to indicate that a specific function should be marked as safe
External functions are assumed to be unsafe (https://doc.rust-lang.org/reference/items/external-blocks.html#r-items.extern.fn.safety) but there should be an option to mark one as safe
For example, for FFI bindings for the PHP source, the function
zend_html_putc(https://github.com/php/php-src/blob/d03163dc0af54f9c0687ab345f5db2584563b2a7/Zend/zend_highlight.c#L28) is always going to be safe - it just prints a character. Similarly,zend_gdb_present(https://github.com/php/php-src/blob/PHP-8.5.10/Zend/zend_gdb.c#L110) takes no parameters and returns a boolean reporting if GDB is present - this function is always going to be safe to callThere should be a way to indicate that a specific function should be marked as safe