[Qgis-developer] Q/A Compiler Warnings

Matthias Kuhn matthias at opengis.ch
Tue Jun 16 04:54:34 PDT 2015


In the quest for an always closer-to-perfection state of code, some
goblins tried to get the warning count (on gcc and clang) yesterday as
close to zero as possible. This was done in order to allow you (as a
developer) to see if your code changes cause warnings without scrolling
through heaps of meaningless warnings.

**What was done?**

Mostly taking care of deprecated code

QgsMapToPixel
which could mostly be ported to the new methods including rotation. Some
leftovers were being made quiet with macros. Having somebody take care
of these would be appreciated.

QgsFeature::geometryAndOwnership()
is deprecated because since QgsGeometry is implicitly shared, a copy of
the geometry is inexpensive. Hence this easy-to-get-wrong
(double-delete, memory leaks) method has been deprecated. It does not
hurt to leave it in place where it is being used now and in feature
freeze the goblins did not want to risk breaking things there so they
used the macro as well to make them quiet.

Some other warnings coming from documentation and data types have been
fixed as well.

**What's left to do?**

At the moment most of the warnings left originate from the geometry
refactoring and point to empty methods which have not yet been
implemented. These warnings point to real problems and should be fixed
as soon as possible, in order to have some time left before release to
be able to test the fixes before the release. @Marco, what is your
schedule concerning these?

Then there will be only one warning left about a double-translations, I
am pretty sure that we can handle this.

**What's the plan for the future?**

The plan is to let travis test for warnings and if there are warnings
mark the build red. With this in place, an author of a commit will be
required to spend some thoughts on a warning and take care of it before
merging into master. As an example, if you deprecate a method, you will
have to check where it is used, where it can be updated to its successor
and where it's required to use the deprecated method and appropriately
put macros there.
IMO this workflow should be preferred to merging code which produces
warnings of which the community (i.e. "somebody out there") will have to
take care of.

Cheers,
Matthias

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150616/6e57b6f2/attachment-0001.pgp>


More information about the Qgis-developer mailing list