Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is readf not returning a value?

Tags:

d

dmd

According to the documentation, readf is supposed to return a uint. But even this simple example fails to compile:

hello.d

import std.stdio;

void main() {
    int x;
    uint r = readf("%s", &x);    
}

error message:

hello.d(5): Error: expression readf("%s",& x) is void and has no value

Am I missing something here?

I'm using dmd (Digital Mars D) compiler v2.050.

like image 398
Benjamin Lindley Avatar asked Mar 31 '11 20:03

Benjamin Lindley


1 Answers

You're missing a new version of DMD. This bug was fixed (silently) in v2.052 (at commit 86a080f).

like image 95
kennytm Avatar answered Oct 06 '22 15:10

kennytm