I am getting an error for void main() function.. Please help me. I am using AT89C51.
while(1); does not return
Generally compilers special case the treatment of main(), assuming it returns an int, and not fussing overly in the absence of the return keyword.
The behaviour if it does return/exit depends on the startup code, but in embedded systems it not usually desirable as there is no-where for the exit code to be propagated too, and the system will either crash, lock, reset, or fail in some manner.