Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » 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, 9:57 am
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 9, 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, 6:21 am
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 9, 2010

Nothing? :sad:
       
Post is unread #3 Jan 3, 2012, 7:24 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
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, 2:58 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
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 8, 2012, 10:43 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
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, 3:12 am
Go to the top of the page
Go to the bottom of the page

Dekar
Fledgling
GroupMembers
Posts11
JoinedApr 9, 2010

Any news?
       
Post is unread #7 May 7, 2013, 6: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 >>