Originally Posted By: Superku
I really don't like that thing of not writing type information but AFAIK all parameters without type are expected to be/ treated as var, as well as the "function" keyword itself (or is it void?). So that should be fine I guess.


function is an alias for var, so the return type is there. Anyway, not declaring a type is something that was legal in K&R C and up to C89, looked something like this:

Code:
void foo(x)
    int bar;
{}



It's no longer valid since C99, for very obvious and good reasons. You can ommit the name though, and write something like "void foo(int, char*)". BSD is infamous for having type signatures like that. Imho everyone who is into the UNIX philosophy of using the least amount of characters to write a function declaration should be stoned, but nobody is asking me who should be stoned anymore these days (but seriously, who is expected to understand "void strncat(char*,const char*, size_t)" without looking it up?!)

So yeah, no, not legal. However, since we are at the topic of C quirkiness, anyone want to take a guess what the difference between these two is?

Code:
void foo();
void bar(void);



Answer:
Click to reveal..

The first one will accept ANY argument, you can call it with as many arbitrary arguments you want. The second one doesn't accept any. C++ did away with that insanity, also for good and obvious reasons.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com