[vdr] return break

Burak BAYER bbayer at havelsan.com.tr
Mon Mar 27 08:32:05 CEST 2006


Udo Richter wrote:

> 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.
>
> Cheers,
>
> Udo
>
>
> _______________________________________________
> vdr mailing list
> vdr at linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
No it isnt  really necessary but i think it is good habit to put break 
statement after a "case". An example of good programming practice.

Dikkat:
Bu elektronik posta mesaji kisisel ve ozeldir. Eger size gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz.Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte, guvenlik nedeni ile kontrol edilerek saklanmaktadir.Mesajdaki gorusler  gondericiye ait olup HAVELSAN A.S. resmi gorusu olmak zorunda degildir.


Attention:
This e-mail message is private and privileged.If you are not the recipient for whom this e-mail message is intended, please notify the sender immediately and delete this e-mail message from your system.All sent and received e-mail messages go through a virus scan in our company, and because of security reasons, they are stored after being controlled.Any opinions presented in this e-mail message are solely those of the author and do not necessarily represent HAVELSAN A.S.'s formal and authorized views.



More information about the vdr mailing list