Skip to content
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

qmimeprovider.cpp:649:18: error: invalid conversion #37

Closed
wants to merge 1 commit into from

Conversation

jschueller
Copy link
Contributor

qt 5.15.0 tarball compilation fails with this error message (linux/gcc 8):

mimetypes/qmimeprovider.cpp: In constructor 'QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate*, QMimeXMLProvider::InternalDatabaseEnum)':
mimetypes/qmimeprovider.cpp:649:18: error: invalid conversion from 'const unsigned char*' to 'Bytef*' {aka 'unsigned char*'} [-fpermissive]
     zs.next_in = mimetype_database;
                  ^~~~~~~~~~~~~~~~~
moc time/qcalendar.h
moc io/qfile.h
moc io/qbuffer.h
moc io/qfiledevice.h
moc io/qiodevice.h
moc io/qnoncontiguousbytedevice_p.h
moc io/qsavefile.h
moc io/qtemporaryfile.h
moc io/qstandardpaths.h
moc io/qfileselector.h
make[3]: *** [.obj/qmimeprovider.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase/src/corelib'
make[2]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase/src'
make[2]: *** [sub-corelib-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase'
make: *** [module-qtbase-make_first] Error 2

qt 5.15.0 tarball compilation fails with this error message (linux/gcc 8):
```
mimetypes/qmimeprovider.cpp: In constructor 'QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate*, QMimeXMLProvider::InternalDatabaseEnum)':
mimetypes/qmimeprovider.cpp:649:18: error: invalid conversion from 'const unsigned char*' to 'Bytef*' {aka 'unsigned char*'} [-fpermissive]
     zs.next_in = mimetype_database;
                  ^~~~~~~~~~~~~~~~~
moc time/qcalendar.h
moc io/qfile.h
moc io/qbuffer.h
moc io/qfiledevice.h
moc io/qiodevice.h
moc io/qnoncontiguousbytedevice_p.h
moc io/qsavefile.h
moc io/qtemporaryfile.h
moc io/qstandardpaths.h
moc io/qfileselector.h
make[3]: *** [.obj/qmimeprovider.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase/src/corelib'
make[2]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase/src'
make[2]: *** [sub-corelib-make_first] Error 2
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/usr/local/src/qt-everywhere-src-5.15.0/qtbase'
make: *** [module-qtbase-make_first] Error 2
```
@jschueller
Copy link
Contributor Author

@jschueller jschueller closed this May 26, 2020
@@ -647,7 +647,7 @@ QMimeXMLProvider::QMimeXMLProvider(QMimeDatabasePrivate *db, InternalDatabaseEnu
#elif defined(MIME_DATABASE_IS_GZIP)
std::unique_ptr<char []> uncompressed(new char[size]);
z_stream zs = {};
zs.next_in = mimetype_database;
zs.next_in = const_cast<Bytef *>(mimetype_database);
Copy link

Choose a reason for hiding this comment

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

While it should work, I'm wondering whether it's better to avoid casting here.

Something like:

QString mimetypeDatabase{mimetype_database};
zs.next_in = mimetypeDatabase.data();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants