Login
User Name:

Password:



Register

Forgot your password?
Hi - Clean SmaugFuss map/description issue..
Dec 15, 2024 7:29 pm
By Samson
AFKMud 2.2.4
Dec 10, 2024 4:09 pm
By Samson
I3 and IMC
Dec 8, 2024 6:35 pm
By Remcon
Ubuntu 22.04.5 LTS
Dec 5, 2024 5:10 pm
By Remcon
SmaugFUSS 1.8/1.9
Nov 29, 2024 11:46 am
By Remcon
SWFOTEFUSS 1.5.1
Author: Various
Submitted by: Samson
SWRFUSS 1.4.1
Author: Various
Submitted by: Samson
SmaugFUSS 1.9.5
Author: Various
Submitted by: Samson
AFKMud 2.2.4
Author: AFKMud Team
Submitted by: Samson
LOP 1.5
Author: Remcon
Submitted by: Remcon
Users Online
AhrefsBot

Members: 0
Guests: 55
Stats
Files
Topics
Posts
Members
Newest Member
494
3,808
19,707
588
Mortrex

Today's Birthdays
There are no member birthdays today.
» SmaugMuds » Codebases » SWR FUSS » GCC 4.6.1 on Ubuntu 11.10
Forum Rules | Mark all | Recent Posts

GCC 4.6.1 on Ubuntu 11.10
< Newer Topic :: Older Topic > Compiling Problems...

Pages:<< prev 1 next >>
Post is unread #1 Dec 26, 2011 11:57 am   
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 10, 2010

 
In Ubuntu 11.10 i'm getting this error while trying to compile swrfuss:

make -s swreality
Compiling o/imc.c
imc.c: In Function 'void imclog(const char*, ...)':
imc.c:212:10: error: variable 'strtime' set but not used [-Werror=unused-but-set-variable]
imc.c: In Function 'void imcbug(const char*, ...)':
imc.c:236:10: error: variable 'strtime' set but not used [-Werror=unused-but-set-variable]
cc1plus: all warnings being treated as errors

make[1]: ** [o/imc.o] Error 1
make: ** [all] Error 2


then i edited the Makefile and added to W_FLAGS the following: -Wno-unused-but-set-variable
and that error stopped.

but then i get other error:

swskills.c: In Function 'void do_torture(CHAR_DATA*, const char*)':
swskills.c:2855:40: error: operation on 'ch->char_data::alignment' may be undefined [-Werror=sequence-point]
cc1plus: all warnings being treated as errors

make[1]: ** [o/swskills.o] Error 1
make: ** [all] Error 2


then, if i remove the -Werror flag from W_FLAGS, it works...

but it won't crash the mud or make it buggy later or make something stops working?

there's a better or another way to fix it?

Thanks in advance for the help...

Dekar

Post is unread #2 Jan 3, 2012 8:21 am   
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 10, 2010

 
Nothing? :sad:

Post is unread #3 Jan 3, 2012 9:24 am   
Go to the top of the page
Go to the bottom of the page

InfiniteAxis
Off the Edge of the Map
GroupAdministrators
Posts1,200
JoinedMar 21, 2006

 
Sorry, somehow I missed this one.

Turning off -wError could have some consequences down the line, but there won't be any immediate consequences from what I can see in what you posted. I'll have to make sure my GCC is up to date at some point this week and have a look at this, but time is something I don't have a lot of atm unfortunately.

Post is unread #4 Jan 3, 2012 4:58 pm   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002

 
I missed this too. Since the IMC2 layer in these codebases is all the same, the problem comes from here:
/* Generic log function which will route the log messages to the appropriate system logging function */
void imclog( const char *format, ... )
{
   char buf[LGST], buf2[LGST];
   char *strtime;
   va_list ap;

   va_start( ap, format );
   vsnprintf( buf, LGST, format, ap );
   va_end( ap );

   snprintf( buf2, LGST, "IMC: %s", buf );

   strtime = ctime( &imc_time );
#if defined(IMCSMAUG)
   log_string( buf2 );
#elif defined(IMCACK)
   monitor_chan( buf2, MONITOR_IMC );
#else
   strtime[strlen( strtime ) - 1] = '\0';
   fprintf( stderr, "%s :: %s\n", strtime, buf2 );
#endif
}

It's because the strtime variable isn't actually needed for Smaug. The simple solution would be to just remove the lines that include it from the two functions the compiler complained about.

The long term solution would be for us to go over the IMC2 code and remove all the optional parts since there's about zero chance the generic snippet will ever get updated again. That's the only reason the compile-time options weren't removed to begin with.

Post is unread #5 Jan 9, 2012 12:43 am   
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,697
JoinedJan 1, 2002

 
A followup to this. My server is running GCC 4.6.1. now and I was going through the several files of SmaugFUSS this error crops up in. It was all going well until I hit the db.c file and all the file reading functions that use the fMatch variable. All of which have a comment saying fMatch isn't used but it shuts the compiler up about it. Oh, the irony.

Thing is, changing the KEY() macro would almost certainly cause any snippets built against the codebase to fail if they're using older logic that requires the fMatch variable to exist.

Post is unread #6 Feb 1, 2012 5:12 am   
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 10, 2010

 
Any news?

Post is unread #7 May 7, 2013 8:28 am   
Go to the top of the page
Go to the bottom of the page

johngaden
Fledgling
GroupMembers
Posts1
JoinedMay 7, 2013

 
The second bit in void_torture is an easy fix.

Line 2980 of swskills.c:

ch->alignment = ch>alignment -= 100;


This code is changing ch->alignment twice between sequence points, once through = and once through -=.
That's whats causing your undefined operation error.

The line should read:

ch->alignment -= 100;
OR
ch->alignment = ch_alignment - 100;


That was the only error I needed to fix out of the box. Hope that helps :)

Pages:<< prev 1 next >>