Login
User Name:

Password:



Register

Forgot your password?
Changes list / Addchange
Author: Khonsu
Submitted by: Khonsu
6Dragons mp3 sound pack
Author: Vladaar
Submitted by: Vladaar
AFKMud 2.2.3
Author: AFKMud Team
Submitted by: Samson
SWFOTEFUSS 1.5
Author: Various
Submitted by: Samson
SWRFUSS 1.4
Author: Various
Submitted by: Samson
Users Online
Google, AhrefsBot

Members: 0
Guests: 28
Stats
Files
Topics
Posts
Members
Newest Member
488
3,788
19,631
595
Khonsu

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,685
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,685
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 >>