[r36] Linux compilation problems

Bugs that have been resolved.

Moderator: Graf Zahl

Locked
User avatar
Jim
Posts: 19
Joined: Tue Sep 13, 2005 23:29

[r36] Linux compilation problems

Post by Jim »

I encountered some problems compiling the latest version (r36). Here they are, along with the fixes I made:
First:
[spoiler]
Compiling t_func.cpp: [ERROR]
g++ -c -pipe -Wall -Wno-unused -O2 -fomit-frame-pointer -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DHAVE_FILELENGTH -D__forceinline=inline -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DNEED_STRUPR -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Isrc/ -Isrc/g_doom/ -Isrc/g_heretic/ -Isrc/g_hexen/ -Isrc/g_raven/ -Isrc/g_shared/ -Isrc/g_strife/ -Isrc/oplsynth/ -Isrc/sound/ -Isrc/fragglescript/ -Isrc/thingdef/ -Isrc/Linux/ -Isrc/sdl/ -Isrc/gl/ -Isrc/gl/r_render/ -Isrc/textures/ -DUSEASM=1 -DNDEBUG -o releaseobj/t_func.o -c src/fragglescript/t_func.cpp
================================================================================In file included from src/fragglescript/t_script.h:702,
from src/fragglescript/t_func.cpp:52:
src/fragglescript/t_fs.h:17:7: warning: no newline at end of file
src/fragglescript/t_func.cpp: In function 'const PClass* T_GetMobjType(svalue_t)':
src/fragglescript/t_func.cpp:265: warning: comparison between signed and unsigned integer expressions
src/fragglescript/t_func.cpp: In member function 'void FParser::SF_StringValue()':
src/fragglescript/t_func.cpp:3242: error: operands to ?: have different types
src/fragglescript/t_func.cpp: In member function 'void FParser::SF_MapThingNumExist()':
src/fragglescript/t_func.cpp:3452: warning: comparison between signed and unsigned integer expressions
src/fragglescript/t_func.cpp: In member function 'void FParser::SF_ObjType()':
src/fragglescript/t_func.cpp:3687: warning: comparison between signed and unsigned integer expressions
src/fragglescript/t_func.cpp: In member function 'void FParser::SF_ThingCount()':
src/fragglescript/t_func.cpp:4053: warning: suggest parentheses around assignment used as truth value
src/fragglescript/t_func.cpp:4067: warning: suggest parentheses around assignment used as truth value
src/fragglescript/t_func.cpp: In member function 'void FParser::SF_KillInSector()':
src/fragglescript/t_func.cpp:4193: warning: suggest parentheses around assignment used as truth value
src/fragglescript/t_func.cpp: In function 'void init_functions()':
src/fragglescript/t_func.cpp:4583: warning: comparison between signed and unsigned integer expressions
make[1]: *** [releaseobj/t_func.o] Error 1
Fixed:

Code: Select all

Index: src/fragglescript/t_func.cpp
===================================================================
--- src/fragglescript/t_func.cpp        (revision 36)
+++ src/fragglescript/t_func.cpp        (working copy)
@@ -3239,7 +3239,15 @@
        if (CheckArgs(1))
        {
                t_return.type = svt_string;
-               t_return.string = t_argv[0].type == svt_string? t_argv[0].string : stringvalue(t_argv[0]);
+               if (t_argv[0].type == svt_string)
+               {
+                       t_return.string = t_argv[0].string;
+               }
+               else
+               {
+                       t_return.string = stringvalue(t_argv[0]);
+               }
+               //t_return.string = t_argv[0].type == svt_string? t_argv[0].string : stringvalue(t_argv[0]);
        }
 }

[/spoiler]
Second:
[spoiler]
Compiling t_variable.cpp: [ERROR]
g++ -c -pipe -Wall -Wno-unused -O2 -fomit-frame-pointer -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12 -DHAVE_FILELENGTH -D__forceinline=inline -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DNEED_STRUPR -Dstricmp=strcasecmp -Dstrnicmp=strncasecmp -Isrc/ -Isrc/g_doom/ -Isrc/g_heretic/ -Isrc/g_hexen/ -Isrc/g_raven/ -Isrc/g_shared/ -Isrc/g_strife/ -Isrc/oplsynth/ -Isrc/sound/ -Isrc/fragglescript/ -Isrc/thingdef/ -Isrc/Linux/ -Isrc/sdl/ -Isrc/gl/ -Isrc/gl/r_render/ -Isrc/textures/ -DUSEASM=1 -DNDEBUG -o releaseobj/t_variable.o -c src/fragglescript/t_variable.cpp
================================================================================In file included from src/fragglescript/t_script.h:702,
from src/fragglescript/t_variable.cpp:55:
src/fragglescript/t_fs.h:17:7: warning: no newline at end of file
src/fragglescript/t_variable.cpp: In function 'const char* stringvalue(const svalue_t&)':
src/fragglescript/t_variable.cpp:126: warning: format '%li' expects type 'long int', but argument 3 has type 'int'
src/fragglescript/t_variable.cpp: In member function 'void DFsVariable::SetValue(const svalue_t&)':
src/fragglescript/t_variable.cpp:257: error: operands to ?: have different types
src/fragglescript/t_variable.cpp: In member function 'DFsVariable* DFsScript::FindVariable(const char*)':
src/fragglescript/t_variable.cpp:361: warning: suggest parentheses around assignment used as truth value
make[1]: *** [releaseobj/t_variable.o] Error 1
Fixed:

Code: Select all

Index: src/fragglescript/t_variable.cpp
===================================================================
--- src/fragglescript/t_variable.cpp    (revision 36)
+++ src/fragglescript/t_variable.cpp    (working copy)
@@ -254,7 +254,14 @@
                break;

        case svt_string:
-               string = newvalue.type == svt_string? newvalue.string : stringvalue(newvalue);
+               if (newvalue.type == svt_string)
+               {
+                       string = newvalue.string;
+               }
+               else
+               {
+                       string = stringvalue(newvalue);
+               }
                break;

        case svt_fixed:
[/spoiler]
Third:
[spoiler]
Compiling t_parse.cpp: [OK]
In file included from src/fragglescript/t_script.h:702,
from src/fragglescript/t_parse.cpp:48:
src/fragglescript/t_fs.h:17:7: warning: no newline at end of file
src/fragglescript/t_parse.cpp:750:7: warning: no newline at end of file
src/fragglescript/t_parse.cpp: In member function 'svalue_t FParser::EvaluateExpression(int, int)':
src/fragglescript/t_parse.cpp:703: warning: cannot pass objects of non-POD type 'class FString' through '...'; call will abort at runtime
Fixed:

Code: Select all

Index: src/fragglescript/t_parse.cpp
===================================================================
--- src/fragglescript/t_parse.cpp       (revision 36)
+++ src/fragglescript/t_parse.cpp       (working copy)
@@ -700,7 +700,7 @@
                FString tempstr;

                for(i=start; i<=stop; i++) tempstr << Tokens[i] << ' ';
-               script_error("couldnt evaluate expression: %s\n",tempstr);
+               script_error("couldnt evaluate expression: %s\n",tempstr.GetChars());
                return nullvar;
        }
 }
@@ -747,4 +747,4 @@



-// EOF
\ No newline at end of file
+// EOF
[/spoiler]
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

Yet another occurence where I want to kick GCC's developers' asses - severely!
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

And next time please attach the patches so I can actually use them.
User avatar
GuntherDW
Posts: 117
Joined: Sat Nov 12, 2005 1:53
Location: Belgium, Antwerp
Contact:

Post by GuntherDW »

Graf Zahl wrote:Yet another occurence where I want to kick GCC's developers' asses - severely!
sorry for the (little) bump,
but you do know that you'll have to kick a lot of dev's asses then, you know :p
there are devs working on GCC all around the world ;)
User avatar
Graf Zahl
GZDoom Developer
GZDoom Developer
Posts: 7148
Joined: Wed Jul 20, 2005 9:48
Location: Germany
Contact:

Post by Graf Zahl »

It's still annoying that GCC is so pedantic just for the sake of it. If that's the C++ standard, if you ask me, the standard needs to be changed.
Locked

Return to “Closed Bugs”