the C switch

Hedley K. J. Rainnie hkr4627 at acf4.UUCP
Sun Mar 3 03:36:00 AEST 1985


Do any C compilers perform switch optimization? I.e. tradeoff cascaded if
for table lookup. Clearly this is an optimization since a table would be
very wasteful for:

    switch(x){
     case 0: a();break;
     case 65535: b();
    }

Just wondering. 

Hedley.



More information about the Comp.lang.c mailing list