https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118136
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> --- 5.1.2.1 General Two execution environments are defined: freestanding and hosted. In both cases, program startup occurs when a designated C function is called by the execution environment. All objects with static storage duration shall be initialized (set to their initial values) before program startup. The manner and timing of such initialization are otherwise unspecified. Program termination returns control to the execution environment. Basically this is correct. Since you are defining a freestanding env, then the definition of main is outside of the scope of the C standard. Which means it needs to be matched up correctly.