Always try to be as strict as possible when programming in C.
Don't ignore compiler warnings, try to get rid of them instead.
Try to compile the above source code using a more strict set of compiler flags:
cc -g -ansi -pedantic -Wall -O2 -o helloworld helloworld.c
You will see something like:
helloworld.c:5: warning: return type defaults to `int'
helloworld.c: In function `main':
helloworld.c:7: warning: control reaches end of non-void function
Fix this by adding a return code, and defining main() as int: