We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This code
pub const XML_ElementDeclHandler = ?extern fn ([*c]const u8, [*c][*c]const u8) void; pub extern fn XML_SetElementDeclHandler(eldecl: XML_ElementDeclHandler) void; extern fn someOtherFunction(a: [*]const u8, b: [*][*]const u8) void { return; } pub fn main() void { XML_SetElementDeclHandler(someOtherFunction); }
gives the following:
test36.zig:9:31: error: expected type '?extern fn([*c]const u8, [*c][*c]const u8) void', found 'extern fn([*]const u8, [*][*]const u8) void' XML_SetElementDeclHandler(someOtherFunction); ^
A big help could be adding notes to help the writer that they should use optionals e.g ?[*]const u8. For example, the last note on this snippet
?[*]const u8
From IRC:
[17:51] < andrewrk> lunamn, yes, in fact I'm pretty sure it's a TODO in the compiler already, just needs a bit of glue code to wire that up
The text was updated successfully, but these errors were encountered:
Now gives:
a.zig:9:31: error: expected type '*const fn([*c]const u8, [*c][*c]const u8) callconv(.C) void', found '*const fn([*]const u8, [*][*]const u8) callconv(.C) void' XML_SetElementDeclHandler(someOtherFunction); ^~~~~~~~~~~~~~~~~ a.zig:9:31: note: pointer type child 'fn([*]const u8, [*][*]const u8) callconv(.C) void' cannot cast into pointer type child 'fn([*c]const u8, [*c][*c]const u8) callconv(.C) void' a.zig:9:31: note: parameter 0 '[*]const u8' cannot cast into '[*c]const u8' a.zig:9:31: note: '[*c]const u8' could have null values which are illegal in type '[*]const u8' referenced by: callMain: zig-out/lib/zig/std/start.zig:604:17 initEventLoopAndCallMain: zig-out/lib/zig/std/start.zig:548:34 remaining reference traces hidden; use '-freference-trace' to see all reference traces
Plenty of tests can be found by grepping for any of those errors.
Sorry, something went wrong.
No branches or pull requests
This code
gives the following:
A big help could be adding notes to help the writer that they should use optionals e.g
?[*]const u8
. For example, the last note on this snippetFrom IRC:
The text was updated successfully, but these errors were encountered: