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

implement defining C variadic functions #13914

Merged
merged 3 commits into from
Dec 18, 2022
Merged

Conversation

Vexu
Copy link
Member

@Vexu Vexu commented Dec 12, 2022

Based on #6272

Closes #515

@InKryption
Copy link
Contributor

Casual bikeshed: would it make sense to prefix the builtins with "c", like @cImport and co? So it would be @cVaStart and @cVaCopy. I don't necessarily think that looks great, but I think it would make sense from a consistency pov.

@lambdadog
Copy link

Casual bikeshed: would it make sense to prefix the builtins with "c", like @cImport and co? So it would be @cVaStart and @cVaCopy. I don't necessarily think that looks great, but I think it would make sense from a consistency pov.

Definitely agree with this. It should be made very clear to the user that they're an antipattern when writing Zig and should be used only for compatibility reasons.

As a note, is it possible to limit vararg usage to callconv(.C) functions? That would, IMO, be the ideal.

@Vexu
Copy link
Member Author

Vexu commented Dec 15, 2022

As a note, is it possible to limit vararg usage to callconv(.C) functions? That would, IMO, be the ideal.

It already is limited, look at the added compile error test.

@lambdadog
Copy link

It already is limited, look at the added compile error test.

Ah, my apologies. I missed that bit.

@Vexu Vexu force-pushed the variadic branch 5 times, most recently from 57c9fb9 to 8d2540c Compare December 17, 2022 10:51
@andrewrk andrewrk merged commit aca9c74 into ziglang:master Dec 18, 2022
@Vexu Vexu deleted the variadic branch December 18, 2022 21:50
andrewrk added a commit that referenced this pull request Dec 28, 2022
This reverts commit aca9c74, reversing
changes made to d93edad.

These changes were not tested with LLVM with assertions enabled. They
caused a regression in master branch, triggering LLVM assertions when
running behavior tests.

Reopens #515
andrewrk added a commit that referenced this pull request Dec 28, 2022
This reverts commit aca9c74, reversing
changes made to d93edad.

These changes were not tested with LLVM with assertions enabled. They
caused a regression in master branch, triggering LLVM assertions when
running behavior tests.

Reopens #515
TUSF pushed a commit to TUSF/zig that referenced this pull request May 9, 2024
implement defining C variadic functions
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

Successfully merging this pull request may close these issues.

support exporting a c-style var args function
4 participants