Author Topic: Ubuntu 18.04 compilation error  (Read 2383 times)

0 Members and 1 Guest are viewing this topic.

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Ubuntu 18.04 compilation error
« 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
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Ubuntu 18.04 compilation error
« on: 15 September, 2018, 18:09:33 »

Offline PPK

  • Administrator
  • Emperor
  • *****
  • Posts: 1 478
  • Karma: +209/-22
  • PtokaX developer
Re: Ubuntu 18.04 compilation error
« Reply #1 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:
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

Offline bastya_elvtars

  • Forum God
  • ****
  • Posts: 3 730
  • Karma: +173/-7
  • The rock n' roll doctor
    • The FreshStuff3 Site
Re: Ubuntu 18.04 compilation error
« Reply #2 on: 15 September, 2018, 21:04:03 »
Thank you, that did the trick!  :)
Everything could have been anything else and it would have just as much meaning.

PtokaX forum

Re: Ubuntu 18.04 compilation error
« Reply #2 on: 15 September, 2018, 21:04:03 »