[vdr] return break

Udo Richter udo_richter at gmx.de
Sun Mar 26 19:21:26 CEST 2006

Patrick Gleichmann wrote:
> Not really important, maybe it is simply a coding style question..
> I came across some switch-cases (e.g. line 339, vdr.c):
> case SOME_VALUE:
>   :
>   return SOME_CODE;
>   break;
> The "break" isn't required.

I'm not sure, but maybe it helps stupid compilers to fully understand 
whats happening, and maybe suppress a false warning.

For example, this function:
   int foo() { if (bar) return 1; else return 0; }
... will trigger a warning in GCC 2.95 because the compiler believes 
that not all paths return a result, though they do.



More information about the vdr mailing list