Skip to content

implicit function calling convention resolution #105

Closed

Description

@andrewrk

Currently if you try to put an export function and a non-extern function in an array, you get an error because the types don't match: extern functionts and non-extern functions have different calling conventions. Same is true for "cold" functions.

However, we can always use the C calling convention - the other conventions are just more optimal if we don't have to. So when the user would get a calling convention type mismatch, instead, cause the calling convention of the affected functions to all switch to the C calling convention, then all the types are satisfied and the user doesn't have to care that a function was declared "cold" or "export".

Activity

  1. added
    enhancementSolving this issue will likely involve adding new logic or components to the codebase.
    and removed on Feb 2, 2016
  2. added this to the 0.2.0 milestone on Apr 10, 2017
  3. modified the milestones: 0.2.0, 0.3.0 on Oct 20, 2017
  4. modified the milestones: 0.3.0, 0.4.0 on Feb 28, 2018
  5. eira-fransham commented on May 29, 2018

    @eira-fransham

    This is a non-local performance hazard, C's calling conventions is slower than fastcall and it would be extremely hard to debug performance issues if it was inferred. Explicit casting isn't that bad and fits in with Zig's philosophy of explicitness.

  6. added
    proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.
    and removed
    enhancementSolving this issue will likely involve adding new logic or components to the codebase.
    on May 29, 2018
  7. modified the milestones: 0.4.0, 0.5.0 on Sep 28, 2018
  8. modified the milestones: 0.5.0, 0.6.0 on Apr 11, 2019
  9. modified the milestones: 0.6.0, 0.7.0 on Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions