Wireshark mailing list archives

Re: MSVC gives warnings "qt_ui_utils.cpp(208, 25): warning C4996: 'QProcess::startDetached'"


From: Graham Bloice <graham.bloice () trihedral com>
Date: Fri, 11 Feb 2022 10:35:17 +0000

From the online Qt docs
<https://doc.qt.io/qt-5/qprocess-obsolete.html#startDetached-2>:
bool QProcess::startDetached(const QString
<https://doc.qt.io/qt-5/qstring.html> &*command*)
<https://doc.qt.io/qt-5/qprocess-obsolete.html#startDetached-2>

This function is obsolete. It is provided to keep old source code working.
We strongly advise against using it in new code.
Hence the MSVC warning, C4996 for a function that's marked as deprecated.
According to the Qt docs you should be using the more extensive overload:
bool QProcess::startDetached(const QString
<https://doc.qt.io/qt-5/qstring.html> &*program*, const QStringList
<https://doc.qt.io/qt-5/qstringlist.html> &*arguments*, const QString
<https://doc.qt.io/qt-5/qstring.html> &*workingDirectory* = QString(),
qint64 <https://doc.qt.io/qt-5/qtglobal.html#qint64-typedef> **pid* =
nullptr)
and you'll have to provide the arguments parameter, even if it's an empty
QStringList.

On Fri, 11 Feb 2022 at 10:15, Anders Broman via Wireshark-dev <
wireshark-dev () wireshark org> wrote:

Hi,

Latest released one

C:\Qt\5.15.2

Regards

Anders



*From:* Roland Knall <rknall () gmail com>
*Sent:* den 11 februari 2022 11:12
*To:* Developer support list for Wireshark <wireshark-dev () wireshark org>
*Cc:* Anders Broman <anders.broman () ericsson com>
*Subject:* Re: [Wireshark-dev] MSVC gives warnings "qt_ui_utils.cpp(208,
25): warning C4996: 'QProcess::startDetached'"



Which Qt version are you on?



Am Fr., 11. Feb. 2022 um 11:06 Uhr schrieb Anders Broman via Wireshark-dev
<wireshark-dev () wireshark org>:

Hi,

Just built and got the following warning:



         ..\ui\qt\utils\qt_ui_utils.cpp(208,25): warning C4996:
'QProcess::startDetached': Use QProcess::startDetached(const QString
&program, const QStringList &arguments) instead
[C:\Development\wsbuild64\ui\qt\qtui.vcxproj]

       ..\ui\qt\utils\qt_ui_utils.cpp(208,25): warning C4996:     success
= QProcess::startDetached(command);
[C:\Development\wsbuild64\ui\qt\qtui.vcxproj]

       ..\ui\qt\utils\qt_ui_utils.cpp(208,25): warning
C4996:                         ^
[C:\Development\wsbuild64\ui\qt\qtui.vcxproj]



    1 Warning(s)



Regards

Anders

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org
?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org
?subject=unsubscribe



-- 
Graham Bloice
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: