[QGIS-trac] [Quantum GIS] #1239: Compilation strict mode and
warnings cleanup for GCC 4.1
Quantum GIS
qgis at qgis.org
Fri Aug 22 08:20:17 EDT 2008
#1239: Compilation strict mode and warnings cleanup for GCC 4.1
------------------------------------------------+---------------------------
Reporter: mloskot | Owner: nobody
Type: patch | Status: new
Priority: minor: annoyance or enhancement | Milestone:
Component: Build/Install | Version: HEAD
Keywords: gcc warnings strictness cleanup | Platform_version: 10.5
Platform: OS X | Must_fix: No
Status_info: 0 |
------------------------------------------------+---------------------------
I've prepared a patch for ''trunk/qgis'' subtree that enables more strict
compilation with GCC 4.1 and cleans number of warnings.
Here is cmake comamnd I used to test compilation after the cleanup:
{{{
cmake \
-D CMAKE_INSTALL_PREFIX=$HOME/usr \
-D CMAKE_BUILD_TYPE=Debug \
-D CMAKE_CXX_FLAGS:STRING="-pedantic -Wall -Wno-long-long -fstrict-
aliasing -Wstrict-aliasing=1" \
-D CMAKE_VERBOSE_MAKEFILE=TRUE ..
}}}
I would suggest to use the CMAKE_CXX_FLAGS above as default compilation
flags. It really helps to find subtle bugs. During the cleanup work, with
help of the stricter compilation mode I've identified following bugs:
#1229, #1233, #1234, #1235, #1236
The only warning that hasn't been cleaned is
{{{
warning: ISO C++ forbids casting between pointer-to-function and pointer-
to-object
}}}
but this is a well known issue of 'dlsym'' call used with C++ compiler
(see #234).
The patch was generated against revision r9120 from inside the trunk using
''svn diff' command.
--
Ticket URL: <http://trac.osgeo.org/qgis/ticket/1239>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats
More information about the QGIS-trac
mailing list