[Gdal-dev] GDAL, Libtiff, Proj4 compiler warnings

Curt, WE7U archer at eskimo.com
Thu Aug 25 13:25:48 EDT 2005


For the Xastir project we use GDAL, Proj4, Shapelib, OGR, libtiff.
We've recently added more strict compiler checking to our Makefiles,
then went through a few rounds of getting rid of the compiler
warnings.

On Linux it builds clean now, but on FreeBSD we have a few warnings
showing up in the external libraries.  Here's a note from one of our
developers that runs FreeBSD:


> No warnings from xastir code.  Only warnings remaining are from
> gdal, libtiff and proj4.  All "declaration not prototype"
> warnings.  Attached, from make with compile lines elided.
>
> These are present both with gcc 2.95 on BSD 4.11 and with gcc 3.4
> on BSD 5.4

-----------------------------------
In file included from /usr/local/include/gdal.h:209,
                 from ../../xastir/src/main.c:132:
/usr/local/include/cpl_error.h:114: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:115: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:116: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:117: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:122: warning: function declaration isn't a prototype

In file included from ../../xastir/src/main.c:132:
/usr/local/include/gdal.h:362: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:652: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:653: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:654: warning: function declaration isn't a prototype

In file included from /usr/local/include/gdal.h:209,
                 from ../../xastir/src/map_gdal.c:115:
/usr/local/include/cpl_error.h:114: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:115: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:116: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:117: warning: function declaration isn't a prototype
/usr/local/include/cpl_error.h:122: warning: function declaration isn't a prototype

In file included from ../../xastir/src/map_gdal.c:115:
/usr/local/include/gdal.h:362: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:652: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:653: warning: function declaration isn't a prototype
/usr/local/include/gdal.h:654: warning: function declaration isn't a prototype

In file included from ../../xastir/src/map_gdal.c:117:
/usr/local/include/ogr_srs_api.h:696: warning: function declaration isn't a prototype

In file included from /usr/local/include/cpl_string.h:93,
                 from ../../xastir/src/map_gdal.c:118:
/usr/local/include/cpl_conv.h:134: warning: function declaration isn't a prototype
/usr/local/include/cpl_conv.h:139: warning: function declaration isn't a prototype
/usr/local/include/cpl_conv.h:225: warning: function declaration isn't a prototype
/usr/local/include/cpl_conv.h:227: warning: function declaration isn't a prototype
/usr/local/include/cpl_conv.h:228: warning: function declaration isn't a prototype

In file included from /usr/local/include/xtiffio.h:10,
                 from ../../xastir/src/map_tif.c:82:
/usr/local/include/tiffio.h:285: warning: function declaration isn't a prototype

In file included from ../../xastir/src/map_tif.c:84:
/usr/local/include/geo_normalize.h:195: warning: function declaration isn't a prototype

In file included from /usr/local/include/projects.h:269,
                 from ../../xastir/src/map_tif.c:85:
/usr/local/include/proj_api.h:126: warning: function declaration isn't a prototype
/usr/local/include/proj_api.h:140: warning: function declaration isn't a prototype
/usr/local/include/proj_api.h:141: warning: function declaration isn't a prototype

In file included from ../../xastir/src/map_tif.c:85:
/usr/local/include/projects.h:420: warning: function declaration isn't a prototype

-----------------------------------

I suspect most of these are easily solved.  In our Xastir code they
were mostly due to "()" instead of "(void)".  The compiler flags
we're using now are:

    -O2 -pipe -W -Wall -Wpointer-arith -Wstrict-prototypes
    -Wno-unused-parameter -pthread

The "-Wno-unused-parameter" flag changes to "-Wno-unused" based on
which GCC version you're using.

--
Curt, WE7U.   APRS Client Comparisons: http://www.eskimo.com/~archer
"Lotto:    A tax on people who are bad at math." -- unknown
"Windows:  Microsoft's tax on computer illiterates." -- WE7U
"The world DOES revolve around me:  I picked the coordinate system!"




More information about the Gdal-dev mailing list