Re: [PATCH] Re: [PATCH] Multi protocol support (stage #1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Trent Piepho wrote:
If you write a switch statement like this:
    switch(d) {
        case DVBFE_DELSYS_DVBS: return 1;
        case DVBFE_DELSYS_DSS: return 1;
        case DVBFE_DELSYS_DVBS2: return 1;
        case DVBFE_DELSYS_DVBC: return 1;
        case DVBFE_DELSYS_DVBT: return 1;
        case DVBFE_DELSYS_DVBH: return 1;
        case DVBFE_DELSYS_ATSC: return 1;
    }

You will get a warning message from gcc:
foo.c:14: warning: enumeration value 'DVBFE_DELSYS_DUMMY' not handled in switch

use default. That will not give you any warnings

If you do that, you will lose the ability of gcc to warn you if you forget
to handle a case.  I do not think the API should force application
programmers to use a certain style.  Obviously, someone likes this warning
or gcc wouldn't have it.


FYI: The kernel coding style is here. http://www.mellanox.com/mst/boring.txt It doesn't matter at all, what arguments you may have !



_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux