PtokaX forum

PtokaX => Bugs => Topic started by: bastya_elvtars on 15 September, 2018, 18:09:33

Title: Ubuntu 18.04 compilation error
Post by: bastya_elvtars on 15 September, 2018, 18:09:33

with or without SQLite support it throws this (Ubuntu installed within Windows 10):


Code: [Select]
/home/szg/PtokaX/core/SettingManager.cpp: In member function ‘void SettingManager::Save()’:
/home/szg/PtokaX/core/SettingManager.cpp:507:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
      if(SetBoolCom[szi] != '\0') {
                            ^~~~
/home/szg/PtokaX/core/SettingManager.cpp:530:29: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
      if(SetShortCom[szi] != '\0') {
                             ^~~~
/home/szg/PtokaX/core/SettingManager.cpp:553:27: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
      if(SetTxtCom[szi] != '\0') {
                           ^~~~
/home/szg/PtokaX/core/SettingManager.cpp: In member function ‘void SettingManager::SetText(size_t, const char*, size_t)’:
/home/szg/PtokaX/core/SettingManager.cpp:1112:41: warning: this statement may fall through [-Wimplicit-fallthrough=]
             if(szLen == 0 || szLen > 64 || strpbrk(sTxt, " $|") != NULL) {
                                         ^
/home/szg/PtokaX/core/SettingManager.cpp:1115:9: note: here
         case SETTXT_TCP_PORTS:
         ^~~~
makefile-sqlite:331: recipe for target '/home/szg/PtokaX/obj/SettingManager.o' failed
make: *** [/home/szg/PtokaX/obj/SettingManager.o] Error 1
Title: Re: Ubuntu 18.04 compilation error
Post by: PPK on 15 September, 2018, 19:06:21
Fixes:
line 507:
Code: C++
  1. if(SetBoolCom[szi][0] != '\0') {
line 530:
Code: C++
  1. if(SetShortCom[szi][0] != '\0') {
line 553:
Code: C++
  1. if(SetTxtCom[szi][0] != '\0') {
line 1111 to 1115:
Code: C++
  1.         case SETTXT_ADMIN_NICK:
  2.             if(szLen == 0 || szLen > 64 || strpbrk(sTxt, " $|") != NULL) {
  3.                 return;
  4.             }
  5.             break;
  6.         case SETTXT_TCP_PORTS:
Title: Re: Ubuntu 18.04 compilation error
Post by: bastya_elvtars on 15 September, 2018, 21:04:03
Thank you, that did the trick!  :)