PDA

View Full Version : Makefile/code needs updating for gcc ver. 4.0+


Arbitrary
September 3rd, 2009, 09:19 PM
Just as fair warning, the makefile and the code will need a little updating. Versions of gcc at 4.0+ no longer include the "-fwritable-strings" option. The resulting compiler error is as follows...

g_game.c: In function ‘G_DoLoadGame’:
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
/usr/include/string.h:397: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
g_game.c:2008: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘strlen’ differ in signedness
/usr/include/string.h:397: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
g_game.c:2008: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
g_game.c:2008: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c:2008: warning: pointer targets in passing argument 1 of ‘__builtin_strcmp’ differ in signedness
g_game.c:2008: note: expected ‘const char *’ but argument is of type ‘byte *’
g_game.c: In function ‘G_ReadDemoTiccmd’:
g_game.c:2324: error: lvalue required as increment operand
g_game.c:2325: error: lvalue required as increment operand
g_game.c:2335: error: lvalue required as increment operand
g_game.c:2337: error: lvalue required as increment operand
g_game.c:2343: error: lvalue required as increment operand
g_game.c:2350: error: lvalue required as increment operand
g_game.c:2352: error: lvalue required as increment operand
make: *** [../objs/g_game.o] Error 1

I'd fix it myself, but I'd have to do a little catchup on my programming before I would know what to fix. I did notice that the newest gcc compiler for linux does use the -march=pentium and -march=486 arguments instead of what was originally there.

Arbitrary
September 4th, 2009, 08:51 AM
Correction... the above error is if you remove the argument '-fwritable strings'. If it is still included, the compiler mentions right away that it doesn't understand the option and halts the creation of the program.

smite-meister
September 18th, 2009, 10:08 PM
That's the source code to Legacy 1.43, not 2.0.

The 2.0 source should compile out of the box and can be found here:
https://doomlegacy.svn.sourceforge.net/svnroot/doomlegacy/legacy/trunk

lead
September 19th, 2009, 01:34 PM
Is there a way to fix this to get 1.43 to compile?

MR_ROCKET
September 20th, 2009, 12:32 PM
Is there any way we could get a new legacy 2.0 win32 binary? :P