Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6147 closed defect (wontfix)

Suppressing more warnings

Reported by: Kurt Schwehr Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

There are a number of places where g++ is warning, but this fix might take a while before anyone gets to it. To get towards a warning free build, are there any objections or issues with patches like this?

Index: frmts/arg/GNUmakefile
===================================================================
--- frmts/arg/GNUmakefile       (revision 30992)
+++ frmts/arg/GNUmakefile       (working copy)
@@ -5,6 +5,7 @@
 OBJ    =       argdataset.o
 
 CPPFLAGS :=    $(JSON_INCLUDE) -I../raw  $(CPPFLAGS)
+CPPFLAGS += -Wno-deprecated-declarations
 
 default:       $(OBJ:.o=.$(OBJ_EXT))
 
Index: gcore/GNUmakefile
===================================================================
--- gcore/GNUmakefile   (revision 30992)
+++ gcore/GNUmakefile   (working copy)
@@ -28,6 +28,8 @@
 
 CPPFLAGS       :=       -I../frmts/gtiff -I../frmts/mem -I../frmts/vrt -I../ogr -I../ogr/ogrsf_frmts/generic -I../gnm/ -I../gnm/gnm_frmts/ $(JSON_INCLUDE) -I../ogr/ogrsf_frmts/geojson $(CPPFLAGS) $(PAM_SETTING) $(XTRA_OPT)
 
+CPPFLAGS += -Wno-deprecated-declarations
+
 ifeq ($(HAVE_SQLITE),yes)
 CXXFLAGS :=    $(CXXFLAGS) -DSQLITE_ENABLED
 endif
Index: gnm/GNUmakefile
===================================================================
--- gnm/GNUmakefile     (revision 30992)
+++ gnm/GNUmakefile     (working copy)
@@ -4,6 +4,9 @@
 OBJ    =       gnmnetwork.o gnmgenericnetwork.o gnmlayer.o gnmrule.o gnmresultlayer.o \
         gnmgraph.o
 
+CPPFLAGS += -Wno-unused-result
+
 default:       lib
 
 all:   lib
Index: ogr/ogrsf_frmts/geoconcept/GNUmakefile
===================================================================
--- ogr/ogrsf_frmts/geoconcept/GNUmakefile      (revision 30992)
+++ ogr/ogrsf_frmts/geoconcept/GNUmakefile      (working copy)
@@ -4,6 +4,7 @@
                ogrgeoconceptdriver.o ogrgeoconceptdatasource.o ogrgeoconceptlayer.o
 
 CPPFLAGS       :=      -DUSE_CPL -I.. -I../..  $(CPPFLAGS)
+CPPFLAGS += -Wno-invalid-source-encoding
 
 default:       $(O_OBJ:.o=.$(OBJ_EXT))
 
Index: ogr/ogrsf_frmts/geojson/GNUmakefile
===================================================================
--- ogr/ogrsf_frmts/geojson/GNUmakefile (revision 30992)
+++ ogr/ogrsf_frmts/geojson/GNUmakefile (working copy)
@@ -20,6 +20,7 @@
        ogrtopojsonreader.o
 
 CPPFLAGS       := $(JSON_INCLUDE) -I. -I.. -I../..  $(CPPFLAGS)
+CPPFLAGS += -Wno-deprecated-declarations
 
 default:        $(foreach d,$(SUBDIRS-yes),$(d)-target) $(O_OBJ:.o=.$(OBJ_EXT))
 
Index: ogr/ogrsf_frmts/gpx/GNUmakefile
===================================================================
--- ogr/ogrsf_frmts/gpx/GNUmakefile     (revision 30992)
+++ ogr/ogrsf_frmts/gpx/GNUmakefile     (working copy)
@@ -6,6 +6,8 @@
 
 ifeq ($(HAVE_EXPAT),yes)
 CPPFLAGS +=   -DHAVE_EXPAT
+else
+CPPFLAGS += -Wno-unused-private-field
 endif
 
 CPPFLAGS       :=      -I.. -I../..  $(EXPAT_INCLUDE) $(CPPFLAGS)
Index: ogr/ogrsf_frmts/selafin/GNUmakefile
===================================================================
--- ogr/ogrsf_frmts/selafin/GNUmakefile (revision 30992)
+++ ogr/ogrsf_frmts/selafin/GNUmakefile (working copy)
@@ -5,6 +5,7 @@
 OBJ    =       ogrselafindriver.o ogrselafindatasource.o ogrselafinlayer.o io_selafin.o
 
 CPPFLAGS       :=      -I.. -I../..  $(CPPFLAGS) 
+CPPFLAGS += -Wno-missing-field-initializers
 
 # To pass -Wextra -Werror, enable this next line:
 # CPPFLAGS += -Wno-missing-field-initializers

Change History (7)

comment:1 by Even Rouault, 9 years ago

I'm a bit concerned with what will happen with those -W switches with non-GCC/non-clang compilers (icc, etc...)

comment:2 by Kurt Schwehr, 9 years ago

Resolution: wontfix
Status: newclosed

Agreed that these types of switches are not compatible across compilers. I think I would have to work something into configure for this to be safe. Thinking that it is not worth the effort to do that when I could be spending the time working on fixing the actual (or compiler perceived) issues. I contemplated putting those in as comments, but that just seems like noise. I think this bug is enough documentation of what is needed to get the non-swig code to be gcc warning free right now and will close the ticket.

The deprecated json calls is something that we will probably need to figure out at some point. I haven't looked at the calls and at the libjson docs to see what the deal is.

comment:3 by Even Rouault, 9 years ago

trunk r31040 "Add AX_CHECK_COMPILE_FLAG macro. Use it to add -Winit-self to warning flags. And use -Wno-unknown-pragmas when available to shut up warnings in FileGDB headers (#6147)"

comment:4 by Even Rouault, 9 years ago

trunk r31045 "Add -Wunused-private-field to warning flags when available (clang) and fix related warnings (#6147)"

comment:5 by Even Rouault, 9 years ago

trunk r31048 "Add -Wmissing-field-initializers when available and fix related warnings (#6147)"

comment:6 by Even Rouault, 9 years ago

trunk r31050 "Add -Wignored-qualifiers when available and fix related warnings (#6147)"

comment:7 by Even Rouault, 9 years ago

trunk r31051 "Add -Wtype-limits when available and fix related warnings (#6147)"

Note: See TracTickets for help on using tickets.