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

Waiting for the fix of Zig : comptime function is executed twice #10

Open
hiroakitakada opened this issue Aug 16, 2020 · 0 comments
Open
Assignees
Labels
waiting Waiting for bug fix or enhancement of Zig

Comments

@hiroakitakada
Copy link
Member

hiroakitakada commented Aug 16, 2020

Zigにcomptimeが2回評価されるという不具合(ziglang/zig#5380 )があるため,それを回避するために,genConfigにダミーのパラメータを渡している。

//  genConfigにvoid型のパラメータを渡すのは,Zigコンパイラの不具合の回
//  避のため(これがないと,genConfigが2回実行される).
pub fn genConfig(comptime dummy: void) type {
    comptime var cfg = CfgData{};
    target.configuration(&cfg);
    configuration(&cfg);
    return GenCfgData(&cfg);
}

@hiroakitakada hiroakitakada added the waiting Waiting for bug fix or enhancement of Zig label Aug 16, 2020
@hiroakitakada hiroakitakada self-assigned this Aug 16, 2020
@hiroakitakada hiroakitakada changed the title Zigの制限の解除待ち:comptimeが2回評価される Waiting for the fix of Zig : comptime function is executed twice Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting Waiting for bug fix or enhancement of Zig
Projects
None yet
Development

No branches or pull requests

1 participant