Thanks for all the helpful replies
@laserlight
if the types of parameters are unspecified why does this produce an error for me?
Code:
#include <stdio.h>
void function1();
int main()
{
function1( 'p' );
}
void function1( char x )
{
return;
}
Code:
eugene@eugene-laptop:~/cfiles$ cc -Wall -pedantic testprototypes.c
testprototypes.c:8:1: warning: C++ style comments are not allowed in ISO C90
testprototypes.c:8:1: warning: (this will be reported only once per input file)
testprototypes.c: In function ‘main’:
testprototypes.c:13: warning: control reaches end of non-void function
testprototypes.c: At top level:
testprototypes.c:25: error: conflicting types for ‘function1’
testprototypes.c:25: note: an argument type that has a default promotion can’t match an empty parameter name list declaration
testprototypes.c:3: error: previous declaration of ‘function1’ was here
eugene@eugene-laptop:~/cfiles$
It didn't work with char types for some reason.