#1135 CLang Warnings in the reference elements

Metadata

Property Value
Reported by Andreas Lauser (andreas.lauser@iws.uni-stuttgart.de)
Reported at Jun 22, 2012 09:02
Type Bug Report
Version 2.0
Operating System Unspecified / All
Last edited by Christoph Grüninger (gruenich@iws.uni-stuttgart.de)
Last edited at Feb 14, 2014 14:31
Closed by Christoph Grüninger (gruenich@iws.uni-stuttgart.de)
Closed at Feb 14, 2014 14:31
Closed in version Unknown
Resolution Fixed
Comment I just check and got no warning anymore with Clang 3.4 and "make check" in dune-grid.
Kudos Clang devs!

Description

I get plenty of clang warnings in the reference elements/generic geometries of the kind:

../../../../dune/geometry/genericgeometry/cornermapping.hh:166:38: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] for( unsigned int i = 0; i < dim-1; ++i )

(to make 'plenty' a concrete number, for testbasicgeometry CLang produces 105 of them.) this is due to checking an unsigned variable for negativity for the specialization for dim = 1. the attached patch replaces these variables by their signed counterparts which suppresses these warnings. I would be surprised if this has an impact on the quality of the generated code, but I admit it's a bit hacky. A "clean" solution would be to fully specialize the respective classes for dim=1 which would be quite intrusive, and, AFAICS, probably would be not worth the effort.

Attachments