Opened 5 years ago

Closed 5 years ago

#28 closed defect

Build is broken on x86_64

Reported by: diversys Owned by: pulkomandy
Priority: Milestone:
Version: Keywords:
Cc:

Description

Can be workarounded by adding '-Wno-type-limits' '-Wno-format' to CMakeLists.txt.

~/Jabber4Haiku/build> make -i
[  2%] Building CXX object CMakeFiles/Jabber.dir/jabber/UserID.cpp.o
/boot/home/Jabber4Haiku/jabber/UserID.cpp: In member function 'void UserID::_ProcessHandle()':
/boot/home/Jabber4Haiku/jabber/UserID.cpp:291:19: error: comparison is always true due to limited range of data type [-Werror=type-limits]
   if (squigly_pos != std::string::npos && squigly_pos != 0) {
       ~~~~~~~~~~~~^~~~~~
/boot/home/Jabber4Haiku/jabber/UserID.cpp:303:18: error: comparison is always false due to limited range of data type [-Werror=type-limits]
    if (slash_pos == std::string::npos) {
        ~~~~~~~~~~^~~~~~
/boot/home/Jabber4Haiku/jabber/UserID.cpp:330:17: error: comparison is always true due to limited range of data type [-Werror=type-limits]
   if (slash_pos != std::string::npos) {
       ~~~~~~~~~~^~~~~~
/boot/home/Jabber4Haiku/jabber/UserID.cpp:334:17: error: comparison is always true due to limited range of data type [-Werror=type-limits]
   if (slash_pos != std::string::npos && slash_pos != 0) {
       ~~~~~~~~~~^~~~~~
/boot/home/Jabber4Haiku/jabber/UserID.cpp:365:17: error: comparison is always true due to limited range of data type [-Werror=type-limits]
     if (amp_pos != std::string::npos) {
         ~~~~~~~~^~~~~~
/boot/home/Jabber4Haiku/jabber/UserID.cpp:372:20: error: comparison is always true due to limited range of data type [-Werror=type-limits]
      if (equal_pos != std::string::npos) {
          ~~~~~~~~~~^~~~~~
cc1plus: all warnings being treated as errors
[  4%] Building CXX object CMakeFiles/Jabber.dir/jabber/JabberSpeak.cpp.o
/boot/home/Jabber4Haiku/jabber/JabberSpeak.cpp: In static member function 'static std::string JabberSpeak::GenerateUniqueID()':
/boot/home/Jabber4Haiku/jabber/JabberSpeak.cpp:140:18: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'pid_t' {aka 'int'} [-Werror=format=]
  sprintf(buffer, "%lu:%lu:%lu", pid, secs, counter);
                  ^~~~~~~~~~~~~  ~~~
cc1plus: all warnings being treated as errors
[  6%] Building CXX object CMakeFiles/Jabber.dir/jabber/GenericFunctions.cpp.o
/boot/home/Jabber4Haiku/jabber/GenericFunctions.cpp: In static member function 'static std::string GenericFunctions::GenerateUniqueID()':
/boot/home/Jabber4Haiku/jabber/GenericFunctions.cpp:67:18: error: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'pid_t' {aka 'int'} -Werror=format=]
  sprintf(buffer, "%lu:%lu:%lu", pid, secs, counter);
                  ^~~~~~~~~~~~~  ~~~
cc1plus: all warnings being treated as errors
[  8%] Building CXX object CMakeFiles/Jabber.dir/jabber/XMLEntity.cpp.o
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp: In member function 'std::string XMLEntity::EscapeText(std::string)':
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:339:53: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find("&", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:344:53: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find("<", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:349:53: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find(">", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp: In member function 'std::string XMLEntity::DeEscapeText(std::string)':
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:360:57: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find("&amp;", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:365:56: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find("&lt;", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLEntity.cpp:370:56: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = text.find("&gt;", replacement)) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
cc1plus: all warnings being treated as errors
[ 11%] Building CXX object CMakeFiles/Jabber.dir/jabber/XMLReader.cpp.o
/boot/home/Jabber4Haiku/jabber/XMLReader.cpp: In member function 'void XMLReader::_OnCharacterData(const XML_Char*, int)':
/boot/home/Jabber4Haiku/jabber/XMLReader.cpp:166:61: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = _curr_character_data.find("&apos;")) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLReader.cpp:170:59: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = _curr_character_data.find("&lt;")) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/boot/home/Jabber4Haiku/jabber/XMLReader.cpp:174:59: error: comparison is always true due to limited range of data type [-Werror=type-limits]
  while ((replacement = _curr_character_data.find("&gt;")) != string::npos) {
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
cc1plus: all warnings being treated as errors
[100%] Built target Jabber

Change History (7)

comment:1 by pulkomandy, 5 years ago

Owner: set to pulkomandy

comment:2 by korli, 5 years ago

since gcc 8.3?

comment:3 by diversys, 5 years ago

Cc: pulkomandy added

Probably, yes. I just noticed new commits the other day by @pulkomandy and decided to build it.

comment:4 by pulkomandy, 5 years ago

Probably because the new buildsystem sets -Wall -Werror. 14th of july I'll attend an xmpp coding sprint and will do more work on thise hopefully enough for a new release of it.

comment:5 by pulkomandy, 5 years ago

Status: newclosed

comment:6 by diversys, 5 years ago

Status: closedreopened

Errors like:
Jabber4Haiku/jabber/UserID.cpp:303:18: error: comparison is always false due to limited range of data type [-Werror=type-limits]
are still there.

comment:7 by diversys, 5 years ago

Status: newclosed

Fixed in master.

Note: See TracTickets for help on using tickets.