Hi David,

On Fri, 20. Feb 2015 at 16:28:19 +0100, David Weiß wrote:
> Thanks for the review. 
> I see your point, but I suggest this should rather be handled by a unit test,
> a linter or -Wswitch-enum for recent compilers.
> I consider switch w/o default bad practice, especially if the enum provides
> kind of a default value.

How would gcc (we usually build with -Wall) or any lint (we use cppcheck and
coverity) catch that there is a new input enum values to handle if there is a
default case?

In the current code the compiler would warn about it, while in the proposed
version it wouldn't have and new enum values that might need handling might be
introduced unnoticed.  In what way would the latter generally be "better
practice"?

I also wonder how a unit test to cover this could look like.


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel. +49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax. +49-4931-918175-50
Software Engineer           D-26506 Norden             http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on FreeNode     
                    

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to