www.digitalmars.com         C & C++   DMDScript  

D - (void)

reply "Pavel Minayev" <evilone omen.ru> writes:
There is a problem with functions (mostly C ones) which
have their parameter list declared as (void) - lots
of such declarations are in stdio.d. D doesn't complain
about prototypes, but when it's time to call the function,
it gives an "argument mismatch" error. Just try to call
getch() or kbhit(), you'll see what I mean.
Jan 07 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
As you might have guessed, simple search-and-replace
of (void) to () solves the problem.
Jan 07 2002
parent reply "Walter" <walter digitalmars.com> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:a1caov$14ra$1 digitaldaemon.com...
 As you might have guessed, simple search-and-replace
 of (void) to () solves the problem.

D should issue an error message about trying to use void as a parameter type!
Jan 07 2002
parent reply "Pavel Minayev" <evilone omen.ru> writes:
"Walter" <walter digitalmars.com> wrote in message
news:a1d0bt$1ich$1 digitaldaemon.com...
 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:a1caov$14ra$1 digitaldaemon.com...
 As you might have guessed, simple search-and-replace
 of (void) to () solves the problem.

D should issue an error message about trying to use void as a parameter type!

Well it doesn't. At least in stdio.d. And so it was when I translated winsock and opengl...
Jan 07 2002
parent "Walter" <walter digitalmars.com> writes:
"Pavel Minayev" <evilone omen.ru> wrote in message
news:a1d0nu$1if1$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:a1d0bt$1ich$1 digitaldaemon.com...
 "Pavel Minayev" <evilone omen.ru> wrote in message
 news:a1caov$14ra$1 digitaldaemon.com...
 As you might have guessed, simple search-and-replace
 of (void) to () solves the problem.

D should issue an error message about trying to use void as a parameter type!

Well it doesn't. At least in stdio.d. And so it was when I translated winsock and opengl...

It will <g>.
Jan 07 2002