This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Getting Error c141: Syntax Error near 'void'

I am getting an error for void main() function.. Please help me. I am using AT89C51.

Parents
  • 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.

Reply
  • 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.

Children
No data