Bug#486347: gcc-4.3: Superfluous warning when -std=c99/gnu99 and noreturn on main()
Bastian Blank wrote:
> Well, main returns always in a hosted environment.
The bug reporter of bug #141015 used exit() on all occasions, I thought that
didn't count as a return? (just curiosity)
I think the noreturn attribute is quite overkill for normal computers
though, this in contrast to embedded development.
> I doubt that you want a hosted compiler environment while building code
> for such a device. Use -ffreestanding and/or use a different name then
I have to admit I might not fully understand what you mean. I looked at the
description of -ffreestanding; I'm under the impression you are talking
about a program that does not use standard libraries, whereas I'm talking
about development using avr-libc.
The avr-libc documentation has this to say about -ffreestanding:
> However, this also turns off all optimizations normally done by the
> compiler which assume that functions known by a certain name behave as
> described by the standard. E. g., applying the function strlen() to a
> literal string will normally cause the compiler to immediately replace
> that call by the actual length of the string, while with -ffreestanding,
> it will always call strlen() at run-time.
Doesn't sound like what I want.
Thanks for the reply,
I'm using the GNU Privacy Guard (GnuPG) in combination with Enigmail.
You can send me encrypted mail if you want some privacy.
My key is available at http://wwwhome.ewi.utwente.nl/~lebbing/pubkey.txt