-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cast from GDALDatasetH to OGRDataSourceH required when constructing gdal::ogr_datasource_unique_ptr #52052
Closed
1 of 2 tasks
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Build/Install
Related to compiling or installing QGIS
macOS
Comments
justinbb
added
the
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
label
Feb 28, 2023
rouault
added a commit
to rouault/QGIS
that referenced
this issue
Mar 10, 2023
…gis#52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
rouault
added a commit
to rouault/QGIS
that referenced
this issue
Mar 10, 2023
…gis#52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
qgis-bot
pushed a commit
that referenced
this issue
Mar 13, 2023
…52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
rouault
added a commit
to rouault/QGIS
that referenced
this issue
Mar 13, 2023
…gis#52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
nyalldawson
pushed a commit
that referenced
this issue
Mar 13, 2023
…52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
nyalldawson
pushed a commit
that referenced
this issue
Mar 13, 2023
…52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
11 tasks
m-kuhn
pushed a commit
to m-kuhn/QGIS
that referenced
this issue
Mar 31, 2023
…gis#52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
nyalldawson
pushed a commit
that referenced
this issue
Apr 1, 2023
…52052) This avoids an implicit case from OGRDataSourceH to GDALDatasetH, that doesn't work with all compilers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
Either a bug report, or a bug fix. Let's hope for the latter!
Build/Install
Related to compiling or installing QGIS
macOS
What is the bug or the crash?
As a result of the GDAL/OGR Unification,
GDALOpenEx()
is used in a few places in QGIS to obtain anOGRDataSourceH
in order to construct an instance ofgdal::ogr_datasource_unique_ptr
. However, the function's return type isGDALDatasetH
. Both are typedefs of void *. Very fussy compilers (e.g. clang on macOS 13 Ventura) do not like this, failing withqgsspatialiteproviderconnection.cpp:481:35: error: no matching constructor for initialization of 'gdal::ogr_datasource_unique_ptr' (aka 'unique_ptr<OGRDataSourceHS, gdal::OGRDataSourceDeleter>') :info:build gdal::ogr_datasource_unique_ptr hDS( GDALOpenEx( pathFromUri().toUtf8().constData(), GDAL_OF_VECTOR | GDAL_OF_UPDATE, nullptr, nullptr, nullptr ) ); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.sdk/usr/include/c++/v1/__memory/unique_ptr.h:121:59: note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'GDALDatasetH' (aka 'void *') to 'const std::unique_ptr<OGRDataSourceHS, gdal::OGRDataSourceDeleter>' for 1st argument
One way of fixing the problem is to cast the return value of
GDALOpenEx()
toOGRDataSourceH
in the following files:src/core/providers/ogr/qgsgeopackagedataitems.cpp
src/core/providers/ogr/qgsogrproviderconnection.cpp
src/providers/spatialite/qgsspatialiteproviderconnection.cpp
There may be a better way: I am not particularly familiar with the code.
Steps to reproduce the issue
This is a compile-time error.
Versions
3.28.3 (and previous)
Supported QGIS version
New profile
Additional context
Using MacPorts to compile and install.
macOS 13.2.1 Ventura, Xcode 14.2, clang 14.0.0, macOS 13 SDK
The text was updated successfully, but these errors were encountered: