Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
6.0.0
-
None
-
MinGW 8.1
-
-
293b7fab55309b59e301c576266d9dabe366b56b (qt/qtbase/dev)
Description
New QProperty system uses offsetof macro in macros like Q_OBJECT_COMPUTED_PROPERTY or Q_OBJECT_BINDABLE_PROPERTY.
This macro itself produces a warning like: offsetof within non-standard-layout type 'QTimerPrivate' is conditionally-supported
To suppress this warning we are using QT_WARNING_DISABLE_INVALID_OFFSETOF macro, which unwraps into smth like
_Pragma(" GCC diagnostics ignored \"-Winvalid-offsetof\"")
on gcc-like compilers.
However this does not work on Windows with MinGW 8.1. See this integrations, for example: https://testresults.qt.io/coin/integration/qt/qtbase/tasks/1610705839
A bit of googling lead me to this long-lasting bug, which seems to be still valid for 8.1: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
I also found the possible solution here: https://stackoverflow.com/questions/43063596/g-ignores-pragma-diagnostic-ignored
One of the original 2012 reports for this issue at GNU's bugzilla included an offhand mention from the reporter, that _Pragma() would be processed as expected if they added either -save-temps or -no-integrated-cpp to the compile command.
Looks like adding -no-integrated-cpp flag for gcc < 9.0.0 should fix the issue.
However I have no idea, how to do it in our build system correctly.
Attachments
Issue Links
- is required for
-
QTBUG-89505 Extend QProperty to cover the needs of qtbase and qtdeclarative
- In Progress
- relates to
-
QTBUG-101411 QT_WARNING_DISABLE_* macros do not work under QCC (8.3.0)
- Closed