Skip to content

handle MSVC warnings - #148

Open
jmckenna wants to merge 1 commit into
OSGeo:masterfrom
jmckenna:cmake-warning-D9025
Open

jmckenna wants to merge 1 commit into
OSGeo:masterfrom
jmckenna:cmake-warning-D9025

Conversation

@jmckenna

Copy link
Copy Markdown
Contributor
  • environment:

    • Visual Studio 2022
    • CMake 4.4.3
    • libgeotiff master
  • master gives the following warnings during compile:

Microsoft (R) Program Maintenance Utility Version 14.44.35228.0
Copyright (C) Microsoft Corporation.  All rights reserved.


[  3%] Building C object CMakeFiles/geotiff_library.dir/cpl_serv.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
cpl_serv.c
[  7%] Building C object CMakeFiles/geotiff_library.dir/geo_extra.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_extra.c
[ 10%] Building C object CMakeFiles/geotiff_library.dir/geo_free.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_free.c
[ 14%] Building C object CMakeFiles/geotiff_library.dir/geo_get.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_get.c
[ 17%] Building C object CMakeFiles/geotiff_library.dir/geo_names.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_names.c
[ 21%] Building C object CMakeFiles/geotiff_library.dir/geo_new.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_new.c
[ 25%] Building C object CMakeFiles/geotiff_library.dir/geo_normalize.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_normalize.c
libgeotiff-git-master\libgeotiff\geo_normalize.c(91): warning C4100: 'unused': unreferenced parameter
[ 28%] Building C object CMakeFiles/geotiff_library.dir/geo_print.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_print.c
[ 32%] Building C object CMakeFiles/geotiff_library.dir/geo_set.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_set.c
[ 35%] Building C object CMakeFiles/geotiff_library.dir/geo_simpletags.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_simpletags.c
[ 39%] Building C object CMakeFiles/geotiff_library.dir/geo_tiffp.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_tiffp.c
[ 42%] Building C object CMakeFiles/geotiff_library.dir/geo_trans.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_trans.c
[ 46%] Building C object CMakeFiles/geotiff_library.dir/geo_write.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geo_write.c
[ 50%] Building C object CMakeFiles/geotiff_library.dir/geotiff_proj4.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
geotiff_proj4.c
[ 53%] Building C object CMakeFiles/geotiff_library.dir/libxtiff/xtiff.c.obj
cl : Command line warning D9025 : overriding '/W3' with '/W4'
xtiff.c
[ 57%] Linking C shared library bin\geotiff.dll
[ 57%] Built target geotiff_library
[ 60%] Building C object bin/CMakeFiles/makegeo.dir/makegeo.c.obj
makegeo.c
[ 64%] Building C object bin/CMakeFiles/makegeo.dir/getopt.c.obj
getopt.c
[ 67%] Linking C executable makegeo.exe
[ 67%] Built target makegeo
[ 71%] Building C object bin/CMakeFiles/listgeo.dir/listgeo.c.obj
listgeo.c
[ 75%] Building C object bin/CMakeFiles/listgeo.dir/getopt.c.obj
getopt.c
[ 78%] Linking C executable listgeo.exe
[ 78%] Built target listgeo
[ 82%] Building C object bin/CMakeFiles/applygeo.dir/applygeo.c.obj
applygeo.c
[ 85%] Building C object bin/CMakeFiles/applygeo.dir/getopt.c.obj
getopt.c
[ 89%] Linking C executable applygeo.exe
[ 89%] Built target applygeo
[ 92%] Building C object bin/CMakeFiles/geotifcp.dir/geotifcp.c.obj
geotifcp.c
[ 96%] Building C object bin/CMakeFiles/geotifcp.dir/getopt.c.obj
getopt.c
[100%] Linking C executable geotifcp.exe
[100%] Built target geotifcp
  • proposed changes:
    • declare in CMakeLists.txt : CMAKE_MINIMUM_REQUIRED(VERSION 3.16...3.29)

    • explicitly set (void)unused

    • resulting in:

    Microsoft (R) Program Maintenance Utility Version 14.44.35228.0
Copyright (C) Microsoft Corporation.  All rights reserved.

[  3%] Building C object CMakeFiles/geotiff_library.dir/cpl_serv.c.obj
cpl_serv.c
[  7%] Building C object CMakeFiles/geotiff_library.dir/geo_extra.c.obj
geo_extra.c
[ 10%] Building C object CMakeFiles/geotiff_library.dir/geo_free.c.obj
geo_free.c
[ 14%] Building C object CMakeFiles/geotiff_library.dir/geo_get.c.obj
geo_get.c
[ 17%] Building C object CMakeFiles/geotiff_library.dir/geo_names.c.obj
geo_names.c
[ 21%] Building C object CMakeFiles/geotiff_library.dir/geo_new.c.obj
geo_new.c
[ 25%] Building C object CMakeFiles/geotiff_library.dir/geo_normalize.c.obj
geo_normalize.c
[ 28%] Building C object CMakeFiles/geotiff_library.dir/geo_print.c.obj
geo_print.c
[ 32%] Building C object CMakeFiles/geotiff_library.dir/geo_set.c.obj
geo_set.c
[ 35%] Building C object CMakeFiles/geotiff_library.dir/geo_simpletags.c.obj
geo_simpletags.c
[ 39%] Building C object CMakeFiles/geotiff_library.dir/geo_tiffp.c.obj
geo_tiffp.c
[ 42%] Building C object CMakeFiles/geotiff_library.dir/geo_trans.c.obj
geo_trans.c
[ 46%] Building C object CMakeFiles/geotiff_library.dir/geo_write.c.obj
geo_write.c
[ 50%] Building C object CMakeFiles/geotiff_library.dir/geotiff_proj4.c.obj
geotiff_proj4.c
[ 53%] Building C object CMakeFiles/geotiff_library.dir/libxtiff/xtiff.c.obj
xtiff.c
[ 57%] Linking C shared library bin\geotiff.dll
[ 57%] Built target geotiff_library
[ 60%] Building C object bin/CMakeFiles/makegeo.dir/makegeo.c.obj
makegeo.c
[ 64%] Building C object bin/CMakeFiles/makegeo.dir/getopt.c.obj
getopt.c
[ 67%] Linking C executable makegeo.exe
[ 67%] Built target makegeo
[ 71%] Building C object bin/CMakeFiles/listgeo.dir/listgeo.c.obj
listgeo.c
[ 75%] Building C object bin/CMakeFiles/listgeo.dir/getopt.c.obj
getopt.c
[ 78%] Linking C executable listgeo.exe
[ 78%] Built target listgeo
[ 82%] Building C object bin/CMakeFiles/applygeo.dir/applygeo.c.obj
applygeo.c
[ 85%] Building C object bin/CMakeFiles/applygeo.dir/getopt.c.obj
getopt.c
[ 89%] Linking C executable applygeo.exe
[ 89%] Built target applygeo
[ 92%] Building C object bin/CMakeFiles/geotifcp.dir/geotifcp.c.obj
geotifcp.c
[ 96%] Building C object bin/CMakeFiles/geotifcp.dir/getopt.c.obj
getopt.c
[100%] Linking C executable geotifcp.exe
[100%] Built target geotifcp

Comment thread libgeotiff/CMakeLists.txt
#
###############################################################################
CMAKE_MINIMUM_REQUIRED(VERSION 3.13)
CMAKE_MINIMUM_REQUIRED(VERSION 3.16...3.29)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make sure this CMake bump is aligned with PROJ and GDAL. There's no reason for the maximum version though, is there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hobu FYI the maximum version in the range is the maximum version of the CMake policies to enable, not the maximum version of CMake you can use. So here this means that all policies added between 3.16 to 3.29 are set to NEW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants