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

incorrectly translated double function pointer #2887

Closed
andrewrk opened this issue Jul 13, 2019 · 0 comments
Closed

incorrectly translated double function pointer #2887

andrewrk opened this issue Jul 13, 2019 · 0 comments
Labels
bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport)
Milestone

Comments

@andrewrk
Copy link
Member

typedef void lws_callback_function(void);
struct Foo {
    void (*func)(void);
    lws_callback_function *callback_http;
};

This C code gets translated to:

pub const lws_callback_function = extern fn() void;
pub const struct_Foo = extern struct {
    func: ?extern fn() void,
    callback_http: [*c]lws_callback_function,
};

I'm not 100% sure but I don't think that's supposed to be a double pointer. You can see the func field got translated as expected, but I think callback_http should be the same thing.

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport) labels Jul 13, 2019
@andrewrk andrewrk added this to the 0.5.0 milestone Jul 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior translate-c C to Zig source translation feature (@cImport)
Projects
None yet
Development

No branches or pull requests

1 participant