Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.10.0
-
None
-
656804b9645a83430dcd0929c49b4065d43d7990
Description
We use this tiny snippet to add a random number to our entroy pool. It works as expected but won't compile with MSVC 2015 (Update 3) and /W3 /WX compile flags.
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include <QRandomGenerator> #endif #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) entropy += QRandomGenerator::securelySeeded().generate(); #endif
Compile error from include:
c:\[...]\include\qtcore\qrandom.h(163): error C2220: warning treated as error - no 'object' file generated c:\[...]\include\qtcore\qrandom.h(163): warning C4003: not enough actual parameters for macro 'min' c:\[...]\include\qtcore\qrandom.h(163): error C2059: syntax error: ')' c:\[...]\include\qtcore\qrandom.h(163): error C2334: unexpected token(s) preceding ':'; skipping apparent function body c:\[...]\include\qtcore\qrandom.h(164): warning C4003: not enough actual parameters for macro 'max' c:\[...]\include\qtcore\qrandom.h(201): error C2143: syntax error: missing ')' before ';' c:\[...]\include\qtcore\qrandom.h(201): error C2059: syntax error: ')' c:\[...]\include\qtcore\qrandom.h(201): error C2238: unexpected token(s) preceding ';' c:\[...]\include\qtcore\qrandom.h(204): error C2504: 'QRandomGenerator': base class undefined c:\[...]\include\qtcore\qrandom.h(205): error C2460: 'QRandomGenerator::QRandomGenerator64::System': uses 'QRandomGenerator::QRandomGenerator64', which is being defined c:\[...]\include\qtcore\qrandom.h(203): note: see declaration of 'QRandomGenerator::QRandomGenerator64' c:\[...]\include\qtcore\qrandom.h(208): error C2873: 'generate': symbol cannot be used in a using-declaration c:\[...]\include\qtcore\qrandom.h(239): warning C4003: not enough actual parameters for macro 'min' c:\[...]\include\qtcore\qrandom.h(239): error C2059: syntax error: ')' c:\[...]\include\qtcore\qrandom.h(239): error C2334: unexpected token(s) preceding ':'; skipping apparent function body c:\[...]\include\qtcore\qrandom.h(240): warning C4003: not enough actual parameters for macro 'max' c:\[...]\include\qtcore\qrandom.h(245): error C2143: syntax error: missing ')' before ';' c:\[...]\include\qtcore\qrandom.h(245): error C2059: syntax error: ')' c:\[...]\include\qtcore\qrandom.h(245): error C2238: unexpected token(s) preceding ';' C:\[...]\source\src\global\Randomizer.cpp(35): error C2059: syntax error: 'using namespace'
Attachments
For Gerrit Dashboard: QTBUG-65414 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
215197,2 | qrandom.h: actually #undef min and max instead of using parentheses | 5.10 | qt/qtbase | Status: MERGED | +2 | 0 |