-
Notifications
You must be signed in to change notification settings - Fork 76
don't do implicit return tasks in naked functions #271
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
Conversation
This commits prevents the compiler from calling destructors and adding the return instructions implicitly in naked functions.
Does this still do them in places where |
Yes.
should produce the following after implementing the suggestions:
|
This looks dangerous. If you forget a return somewhere, you will start executing code of another function. On the other hand, having the implicit return there only costs 8 bytes of memory. I am not sure what the great advantage of this is... |
Or to put it another way:
Using things like |
@Y-Less I would consider myself someone who knows, what they are doing, regarding this stuff. However, I still make mistakes sometimes. And my point is, that I really don't see the advantage. |
@samphunter You have the control. You are essentially telling the compiler that don't add instructions to handle implicit return by marking a function as |
@YashasSamaga fair enough. I guess I can always just add explicit return to suppress the warning without using naked. |
Is this ready to be merged? The justification sounds fine and logical to me. |
This commits prevents the compiler from calling destructors and adding the return instructions implicitly in naked functions.
fix for #262