Sandeep wrote:
The C startup routine does the following:
- Initialize all global variables to 0
- Call standard library init
- Prepares argc and argv
- Calls main
Sandeep...
Perhaps (more or less; possibly more /and/ less :-)
[less] One would hope that the compiler emits code that
pre-initializes all globals;
[more] If the startup function calls main directly, then it will
also need to provide for main's return.
This /is/ off-topic for comp.lang.c because nearly every aspect
of the subject is platform/implementation dependent; and the OP's
question has nothing to do with the C language itself; but rather
with a particular implementation (gcc) whose startup function is
likely to vary at least somewhat for each target platform.
Since the OP didn't specify a platform, providing a list of
specifics is almost certainly a misleading response - however
well-intended.
--
Morris Dovey
West Des Moines, Iowa USA
C links at
http://www.iedu.com/c