Content originally posted in LPCWare by CodeRedSupport on Wed May 11 08:41:43 MST 2011
Quote: larryvc
So why do we have int main(void) in LPCXpresso? A return value is not necessary as the catch loop does not use it.
To be honest, in the testing I have done - it basically makes no difference. Feel free to post an example where it does if you have one.
One thing to note is that although the default code provided in main.c by the project wizard includes an infinite while(1) loop - you can actually remove this if you are using the standard startup file, as this actually contains a while(1) loop after the call to main()/__main() anyway.
Having the while(1) in main() just makes the loop more obvious, and as it increments a counter, makes it easier to see that the loop is looping.
Regards,
CodeRedSupport