quote:
Originally posted by Calum:
hello.c:2: warning: return type defaults to `int'
hello.c:2: warning: function declaration isn't a prototype
hello.c: In function `main':
hello.c:5: warning: control reaches end of non-void function
Choasforages is right, but for a more detailed note on what it actually says:
warning: return type defaults to `int'
Your 'main' function doesn't have a return type. This must be something. 'void' is for functions that don't have to return anything, int and char are what it says. The standard for the main() function is int, most programs use that (it's standard to use that for error codes, where '0' is normal execution).
GCC defaults to 'int'
warning: control reaches end of non-void function
main() is now a function that returns an integer (it isn't 'void', which means it has to return something), but it reached the end without seeing a 'return'.
warning: function declaration isn't a prototype
hello.c: In function `main':
This probably has to do with #include being in the body of the program. #include copies everything in the given header file in the source (the preprocessor does this), and so all the functions in the include file land *in* the main() function which isn't good.
Hope that helped cure your noseyness