Hi, On Thu, 31 Jan 2013, Vincent Lefevre wrote:
> > >In such a case, a "default:" at the end with an assertion failure > > >would have been better. > > > > No. An assertion only makes sense to make sure about what we aren't > > entirely sure. In this case we are sure (that "default" never happens). > > You are sure *now*. But imagine that in the future you modify the "if" > at the beginning of the loop to add a 4th operator but you forget to > modify the switch... > > BTW, since you are sure now and think an assert is useless anyway, > removing the "default:" (or adding an empty "default:" at the end) > now should be completely safe. It will lead to slower and/or larger code to add a default case with a separate body. The current way of doing it is IMO the exactly correct way. If people are really confused by that, put a comment next to the 'default:'. Generally stylistic "warnings" of coverity (and actually not just stylistic things) have to be taken with a huge amount of salt. Ciao, Michael. _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel