[PATCH]: fix compile warnings in wpa_gui

Kel Modderman kel
Wed Dec 26 03:42:18 PST 2007


The following warnings can be observed while compiling wpa_gui:

g++ -c -pipe -fpermissive -O2 -Wall -W -D_REENTRANT -DQT_SHARED -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX -DQT_NO_DEBUG -DQT_QT3SUPPORT_LIB -DQT3_SUPPORT -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4/Qt3Support -I/usr/include/qt4/Qt3Support -I/usr/include/qt4 -I. -I.. -I../../src/utils -I../../src/common -I.moc -I.ui -o .obj/networkconfig.o .ui/networkconfig.cpp
In file included from .ui/networkconfig.cpp:9:
.ui/../networkconfig.ui.h: In member function 'virtual void NetworkConfig::addNetwork()':
.ui/../networkconfig.ui.h:137: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:140: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:143: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:144: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:147: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:148: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:151: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:152: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:155: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:156: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:164: warning: deprecated conversion from string constant to 'char*'
.ui/../networkconfig.ui.h:166: warning: deprecated conversion from string constant to 'char*'

The attached patch fixes them. I'm pretty sure none of the strings marked as
constants by this patch are expected to be modifiable by other functions.

Signed-off-by: Kel Modderman <kel at otaku42.de>
---
--- a/wpa_supplicant/wpa_gui/networkconfig.ui.h
+++ b/wpa_supplicant/wpa_gui/networkconfig.ui.h
@@ -131,7 +131,7 @@
 
     setNetworkParam(id, "ssid", ssidEdit->text().ascii(), true);
     
-    char *key_mgmt = NULL, *proto = NULL, *pairwise = NULL;
+    const char *key_mgmt = NULL, *proto = NULL, *pairwise = NULL;
     switch (auth) {
     case AUTH_NONE:
 	key_mgmt = "NONE";
---




More information about the Hostap mailing list