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

Variadic native functions #2057

Closed
nikomatsakis opened this issue Mar 27, 2012 · 4 comments · Fixed by #10064
Closed

Variadic native functions #2057

nikomatsakis opened this issue Mar 27, 2012 · 4 comments · Fixed by #10064
Labels
A-codegen Area: Code generation A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. P-low Low priority

Comments

@nikomatsakis
Copy link
Contributor

We should support variadic native functions like objc_msgSend() or printf().

@catamorphism
Copy link
Contributor

Nominating for "maturity #3 - feature complete"

@emberian
Copy link
Member

Triage bump

@catamorphism
Copy link
Contributor

Low, not 1.0

@lilyball
Copy link
Contributor

lilyball commented Nov 5, 2013

For the record, objc_msgSend() is not a variadic function. It's a hand-coded assembly trampoline that finds the real function and calls it. The real function uses normal C calling conventions, not varargs conventions (unless, of course, it actually includes varargs itself).

When using objc_msgSend() directly in code, you must cast it to the appropriate type. For example, in order to call a theoretical method -[NSObject setInteger:(int)i] you need to say

((void(*)(id,SEL,int))objc_msgSend)(obj, @selector(setInteger:), i);

@bors bors closed this as completed in 1c56652 Nov 5, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Apr 23, 2024
Add localtime_r shim

- Implement ``localtime_r`` shim as mentioned in rust-lang#2057

Note:
- ``tm_zone``, ``tm_gmtoff`` might not be consistent with ``libc::localtime_r`` as custom implementation is provided through ``chrono``. Due to the lack of daylight saving information in ``chrono``, ``is_dst`` value will always be ``-1``.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-codegen Area: Code generation A-typesystem Area: The type system C-enhancement Category: An issue proposing an enhancement or a PR with one. P-low Low priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants