[net.lang.c++] DMD problems; f

bs@alice.UucP (Bjarne Stroustrup) (09/24/86)

> Guido van Rossum, CWI, Amsterdam <guido@mcvax.uucp>
> ... error is emitted by CC for a more conventional fragment like this:
> 
> 	extern int f();
> 	main() { f(1); }
> 
> 	"x.c", line 2: error: un expected 1 argument for f()
> 
> The error is simply that f() is declared as a function with no argument,
> but called as a function with one argument.  This is an error in C++,
> but not in C.  Unfortunately C++ has chosen a different solution to cope
> with this incompatibility than [proposed] ANSI C; in ANSI C, f() means
> that f's arguments are unknown, and one writes f(void) to state
> explicitly that f has no arguments. ...

I may be worth nothing that the example above is also bad ANSI C. Calling a
function with an argument after it has been declared without one is a case
where ANSI C recommends issuing a warning. Thus, a good ANSI C compiler will
agree with C++ here. If you mean to declare ``f(accept_any_old_garbage)'' you
can write ``f(...)'' in both C++ and ANSI C.