Use weak reference to iocshRegister so that the same init code can be used with full IOC applications (which include the iocsh routines) and also with IOC test programs (which do not include the iocsh routines). Don't treat a return from main() as a fatal error condition.