Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document macro-ed binary invocation methods #98

Open
str4d opened this issue Aug 25, 2023 · 1 comment
Open

Document macro-ed binary invocation methods #98

str4d opened this issue Aug 25, 2023 · 1 comment

Comments

@str4d
Copy link
Contributor

str4d commented Aug 25, 2023

Being a bit of a devils advocate here: main also, seems to be unsafe since the caller is again required to provide a valid pointer.

The same logic works here as with parse: since it is a generated function, it is accessible to nearby code which may, for example, call it with null.

Not to be too copy-pasty here, something like

# Safety

This should only be called by Flipperzero OS
and never manually.

would be enough.

Originally posted by @JarvisCraft in #95 (comment)

@dcoles
Copy link
Collaborator

dcoles commented Aug 28, 2023

I agree something like main(args: *mut u8) should be marked unsafe since it has the prerequisite that args contains NUL-terminated bytes. It's also not something that user programs should typically be doing (intended to be called only by the Flipper runtime).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants