[Bug target/15037] -ffreestanding not taken into account when compiling main()
xtrochu at yahoo dot com
gcc-bugzilla@gcc.gnu.org
Wed Apr 21 12:37:00 GMT 2004
------- Additional Comments From xtrochu at yahoo dot com 2004-04-21 11:54 -------
Looking up the documentation for "-ffreestanding", I see no reason why the
compiler should make _any_ assumption about "main()" being the entry point of a
program, and thus would include hidden calls to a __main() or _alloca() function.
http://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/C-Dialect-Options.html#C%20Dialect%20Options
"freestanding environment is one in which the standard library may not exist,
and program startup may not necessarily be at main."
http://gcc.gnu.org/onlinedocs/gcc-3.3.3/gcc/Standards.html#Standards
"... where the handling of program startup and termination are
implementation-defined ..."
I don't think this bug being invalid.
The actual behavior is that you simply can't use the word "main" as a function
name in freestanding environment, so either the documentation should point out
that fact or the behavior should be corrected. I would prefer the later.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15037
More information about the Gcc-bugs
mailing list