imc.c more errors

Posted by Glennjoos on Mon 27 Apr 2020 07:16 PM — 11 posts, 42,040 views.

#0
I am using gcc version 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC)

Downloaded the 1.9 SmaugFUSS

Running an a virtual Fedora 31 in VM Workstation

glennjoos@ess-linux src]$ make
make -s smaug
Compiling o/imc.o....
imc.c: In function ‘void imc_update_tellhistory(CHAR_DATA*, const char*)’:
imc.c:1565:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
1565 | if( IMCTELLHISTORY( ch, x ) == '\0' )
| ^~~~
imc.c: In function ‘void imclog(const char*, ...)’:
imc.c:218:32: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4091 [-Werror=format-truncation=]
218 | snprintf( buf2, LGST, "IMC: %s", buf );
| ^~ ~~~
imc.c:218:12: note: ‘snprintf’ output between 6 and 4101 bytes into a destination of size 4096
218 | snprintf( buf2, LGST, "IMC: %s", buf );
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
imc.c: In function ‘void imcbug(const char*, ...)’:
imc.c:232:33: error: ‘%s’ directive output may be truncated writing up to 4095 bytes into a region of size 4090 [-Werror=format-truncation=]
232 | snprintf( buf2, LGST, " IMC: %s", buf );
| ^~ ~~~
imc.c:232:12: note: ‘snprintf’ output between 7 and 4102 bytes into a destination of size 4096
232 | snprintf( buf2, LGST, " IMC: %s", buf );
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Getting a bunch of this.
Is my compiler just too new?
USA Global Moderator #1
Quote:
Downloaded the 1.9 SmaugFUSS

Can you provide a link?
Amended on Mon 27 Apr 2020 09:26 PM by Fiendish
#2
https://smaugmuds.afkmods.com/files/
USA Global Moderator #3
It looks like that hasn't been updated in a long time. What if you try the one from this github repository, which looks like it's much more recent? https://github.com/Arthmoor/SmaugFUSS
#4
ok Fiendish, did what you suggested, and now...

glennjoos@ess-linux src]$ make
make -s smaug
Compiling o/imc.o....
Compiling o/act_comm.o....
Compiling o/act_info.o....
Compiling o/act_move.o....
Compiling o/act_obj.o....
Compiling o/act_wiz.o....
Compiling o/ban.o....
Compiling o/boards.o....
Compiling o/build.o....
Compiling o/calendar.o....
Compiling o/chess.o....
Compiling o/clans.o....
Compiling o/color.o....
Compiling o/comm.o....
In file included from comm.c:30:
mccp.h:18:10: fatal error: zlib.h: No such file or directory
18 | #include <zlib.h>
| ^~~~~~~~
compilation terminated.
make[1]: *** [Makefile:102: o/comm.o] Error 1
make: *** [Makefile:46: all] Error 2



But let me ask you this, I have a 1.4 mud I owned back in 2002 named Snowdens Revenge. I kinda want to get it back running, is it worth upgrading Smaug? I do have bugs now, but it runs.
Australia Forum Administrator #5

Install the zlib library from: https://www.zlib.net/

I had a similar problem in Ubuntu recently (because I had reinstalled it). To fix that:

sudo apt install zlib1g-dev
Amended on Thu 30 Apr 2020 03:44 AM by Nick Gammon
USA Global Moderator #6
Quote:
But let me ask you this, I have a 1.4 mud I owned back in 2002 named Snowdens Revenge. I kinda want to get it back running, is it worth upgrading Smaug? I do have bugs now, but it runs.

That question is a whole other kettle of fish. I would say that upgrading is definitely worthwhile. The fixes between 1.4 and 1.9 are pretty signfiicant. MCCP support wasn't added until v1.6 for instance. But I can't predict how it will affect any customizations you've made.
Amended on Wed 29 Apr 2020 11:26 PM by Fiendish
#7
Nick, I checked that first.

Last metadata expiration check: 0:19:14 ago on Thu 30 Apr 2020 10:21:21 AM EDT.
Package zlib-1.2.11-21.fc32.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!


sudo yum install zlib1g-dev
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:20:43 ago on Thu 30 Apr 2020 10:21:21 AM EDT.
No match for argument: zlib1g-dev
Error: Unable to find a match: zlib1g-dev
USA Global Moderator #8
1. Fedora and Ubuntu don't use the same name scheme for development packages. Fedora calls it zlib-devel.
2. You should really use dnf instead of yum these days.
Amended on Thu 30 Apr 2020 04:05 PM by Fiendish
#9
ok, did all that, hopefully this is the last question.

Did the make, everything ran just fine. But, I dont see a startup file in /src. This the the git download Feindish suggested.
#10
nevermind.... chmod is your friend.

thanks for all your help.