-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Proposal: remove implicit callconv(.C)
on extern
functions
#5269
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
Comments
|
This would require a bit more work, but overall, I'm in favor of this. Calling convention must then be defined. The default calling convention is "unspecified." For obvious reasons, this isn't usable for exported / extern functions (note: this proposal must also apply to |
I see the accepted label has been removed, and I don't support this change anymore. Learning from the In the case of I realized that this could apply to #1717 too, where typing the new syntax is significantly more inconvenient: fn foo() i32 {}
const foo = fn() i32 {} For all of these cases, there's a clear rule for when to use which: use the more verbose syntax when you need it, and the shorter syntax when you don't.
[Whoops, accidentally posted the comment before I had a chance to finish/think about it. I guess it stays] Another thought: the logic for |
Uh oh!
There was an error while loading. Please reload this page.
Currently, these do the same thing:
extern fn foo() void;
extern fn foo() callconv(.C) void;
Callconv didn't exist before, so extern was the only way to mark the calling convention. Now that we have callconv, the implicit calling convention isn't needed anymore.
The text was updated successfully, but these errors were encountered: