Warum sollte GCC motzen, ist ja ein syntaktisch korrektes C-Programm

GCC kennt tausende von Warnungen. Einige davon bekommst du mit -W -Wall

Speziell in deinem Fall hätte dich folgendes aus der Kurve gehebelt:

avr-gcc ... -Wunreachable-code -Werror

Zitat Zitat von avr-gcc
-Wunreachable-code

Warn if the compiler detects that code will never be
executed.

This option is intended to warn when the compiler
detects that at least a whole line of source code will
never be executed, because some condition is never
satisfied or because it is after a procedure that
never returns.

It is possible for this option to produce a warning
even though there are circumstances under which part
of the affected line can be executed, so care should
be taken when removing apparently-unreachable code.

For instance, when a function is inlined, a warning
may mean that the line is unreachable in only one
inlined copy of the function.

This option is not made part of -Wall because in a
debugging version of a program there is often
substantial code which checks correct functioning of
the program and is, hopefully, unreachable because the
program does work.

Another common use of unreachable
code is to provide behavior which is selectable at
compile-time.