[Gdal-dev] why have warning message when building GDAL-1.2.0 on windows ?

Frank Warmerdam warmerdam at pobox.com
Mon Jul 26 10:41:08 EDT 2004


Denzel wrote:
>    Why I get these warning message? Thanks!!
> 
> Here is some  log file gdal-1.2.0.log I get it when
> compile the gdal-1.2.0
> 
> ----------------------------------------------
> avc_e00read.c
> avc_e00read.c(635) : warning C4047: '==' : 'int '
> differs in levels of indirection from 'void *'

Denzel,

The current release is GDAL 1.2.1.  Several of the messages
you report (including the avc_e00read one above) are not at
the same line in the current release and aren't easily related.

In the case of the AVC code, it comes from an upstream library
I don't directly maintain. Nevertheless the error looks odd
enough I would like to fix it if possible.  I would add it does
not happen with "gcc -Wall" on linux ... at least not with the
current code.

> tif_overview.c
> tif_overview.c(155) : warning C4761: integral size
> mismatch in argument; conversion supplied

I have corrected this upstream in libtiff, and migrated it into
GDAL.  I don't believe there was any actual error occuring.

> tif_getimage.c(2041) : warning C4550: expression
> evaluates to a function which is missing an argument
> list
> tif_getimage.c(2077) : warning C4550: expression
> evaluates to a function which is missing an argument
> list

I have found it difficult to avoid this warning without
introducing problems on at least some support libtiff
architectures so I have learned to live with it.

> ..\..\jpeg\libjpeg\jmorecfg.h(162) : warning C4142:
> benign redefinition of type
> 	cl /nologo /Ox /MD -I..\..\..\port -I..\..\..\ogr
> -I..\..\..\gcore -I..\..\zlib -DZIP_SUPPORT
> -I..\..\jpeg\libjpeg -DJPEG_SUPPORT /c tif_flush.c

The above warning means that a type was redefined, but the
redefinition was essentially the same - hence it is benign.
I have also had a great deal of difficulty over the years
dealing with build problems related to libjpeg on windows
due to the large mixture of includes files that come
together when compiling libtiff and libjpeg on windows.

> gdal_translate.cpp
> gdal_translate.cpp(778) : warning C4508: 'main' :
> function should return a value; 'void' return type
> assumed

I was unable to track this down.  It doesn't happen on
Linux and may have already been fixed.  In any event it
is "mostly harmless".


> gdaladdo.cpp
> gdaladdo.cpp(133) : warning C4508: 'main' : function
> should return a value; 'void' return type assumed
>    Creating library gdaladdo.lib and object
> gdaladdo.exp

I committed a change (to return a proper exit status via
exit()) that I think will correct this.

> 	cl /nologo /Ox /MD -I..\port -I..\ogr -I..\gcore 
> -I..\frmts -I..\alg gdalwarp.cpp  ..\gdal_i.lib  /link
> 
> gdalwarp.cpp
> gdalwarp.cpp(521) : warning C4508: 'main' : function
> should return a value; 'void' return type assumed

I think this is already corrected.  I see that gdalwarp's
main() now ends with exit(0).

In general, different compilers tend to turn up different sorts of
warnings.  Generally speaking they are harmless, but it is hard to
notice dangerous warnings without fixing harmless warnings as they arise.
So I do make an effort to ensure all my software compiles warning free -
at least on my reference platform (gcc 3.x with -Wall).  However, I am
not always successful and things tend to be noisier on platforms other
than gcc (such as windows).  Nevertheless - as far as I can I am
interested in cleaning up warnings.

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent




More information about the Gdal-dev mailing list