Skip to content

Commit 120a61c

Browse files
author
jef
committedAug 23, 2008
various code cleanups by mloskot for GCC 4.1 (fixes #1239, #1240).
Inspired by it I also enabled pedantic mode for MSVC and cleaned up some more warnings found by GCC 4.3 and MSVC. git-svn-id: http://svn.osgeo.org/qgis/trunk@9133 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 07c905b commit 120a61c

File tree

107 files changed

+333
-377
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+333
-377
lines changed
 

‎CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,21 @@ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
167167
# enable warnings
168168

169169
IF (PEDANTIC)
170-
ADD_DEFINITIONS( -Wall -Werror )
170+
MESSAGE ("Pedantic compiler settings enabled")
171+
IF(MSVC)
172+
ADD_DEFINITIONS( /W4 )
173+
174+
# disable warnings
175+
ADD_DEFINITIONS( /wd4100 ) # unused formal parameters
176+
ADD_DEFINITIONS( /wd4127 ) # constant conditional expressions (used in Qt template classes)
177+
ADD_DEFINITIONS( /wd4510 ) # default constructor could not be generated (sqlite3_index_info, QMap)
178+
ADD_DEFINITIONS( /wd4512 ) # assignment operator could not be generated (sqlite3_index_info)
179+
ADD_DEFINITIONS( /wd4610 ) # user defined constructor required (sqlite3_index_info)
180+
ELSE (MSVC)
181+
ADD_DEFINITIONS( -Wall -Werror -Wno-long-long )
182+
# Qt produces lots of warnings with strict aliasing (as of Qt 4.4.0 & GCC 4.3)
183+
# ADD_DEFINITIONS( -fstrict-aliasing -Wstrict-aliasing=1 )
184+
ENDIF (MSVC)
171185
ENDIF (PEDANTIC)
172186

173187
IF (CMAKE_BUILD_TYPE MATCHES Debug)

‎src/app/legend/qgslegend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class QTreeWidgetItem;
8282

8383
class QgsLegend : public QTreeWidget
8484
{
85-
Q_OBJECT;
85+
Q_OBJECT
8686
private:
8787
// Moved here to match access of declaration later in file.
8888
// Previous location raised a warning in msvc as the forward

0 commit comments

Comments
 (0)
Please sign in to comment.