At 04:32 AM 2/4/2010, you wrote: >While getting to grips with C18 quite happily, I discovered >(http://users.aber.ac.uk/auj/voidmain.shtml) that using "void main >(void)" , as most C18 demo code does, is frowned upon. > >I'm asking any seasoned C18 philosophers out there; is this cause for >concern? I don't know enough about C yet to predict whether this is >really an issue or not, purely in the case of using C18 for PIC development. > >Regards, >Matt IMHO, this is a case of a bit of knowledge being dangerous, or at least annoying. If you read the C standard ISO/IEC 9899:1999 (E) , it is only a requirement of conforming *hosted* implementations that main be defined as int. Parameters are optional. Typically PICs operate in a *freestanding* environment (no operating system), which means that there is no precise requirement as to the effect of program termination, what code is actually called at start-up-- it's "implementation defined". In either hosted or freestanding conforming implementations, initialization of statics is guaranteed, though. So, I don't think it's a big deal one way or the other. If you define main as int you have to return something (typically 0 for successful termination) or the compiler will complain, so it might end up using a few more bytes. In freestanding implementations, of course, your program should *never* terminate, because there is nowhere to go. Maybe there's an implementation defined reset or something like that. Usually if you're using C, a few more bytes get lost in the noise. Personally, I use void main(void) and look at the assy code of a very small program to make sure I know precisely what is going on with the program and startup code. It's a bit irritating, because often there is an unnecessary call, which uses a stack level. >Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist