commit 0c2a1d814640d446e32f4234d9ce863eb1f5c798
Author: Jean-Marc Lasgouttes <[email protected]>
Date: Tue Jul 1 11:18:02 2025 +0200
Avoid wrong const cast
Spotted by Scott.
Clang gives the following warning:
src/frontends/qt/GuiAlert.cpp:55:33: warning: cast from 'const char *' to
'char *' drops const qualifier [-Wcast-qual]
55 | QApplication app(argc, (char**)argv);
| ^
---
src/frontends/qt/GuiAlert.cpp | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/frontends/qt/GuiAlert.cpp b/src/frontends/qt/GuiAlert.cpp
index 8137032a88..e942996dc4 100644
--- a/src/frontends/qt/GuiAlert.cpp
+++ b/src/frontends/qt/GuiAlert.cpp
@@ -49,10 +49,11 @@ namespace frontend {
void noAppDialog(QString const & title, QString const & msg, QMessageBox::Icon
mode)
{
+ string appname = "lyx";
int argc = 1;
- const char *argv[] = { "lyx", 0 };
+ char *argv[] = { appname.data(), nullptr };
- QApplication app(argc, (char**)argv);
+ QApplication app(argc, argv);
switch (mode)
{
case QMessageBox::Information: QMessageBox::information(0,
title, msg); break;
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs