Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
 Couple bugs
Yesterday, 5:42 pm
By Remcon
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
LOP 1.45
Author: Remcon
Submitted by: Remcon
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
Users Online
CommonCrawl, Yandex, DotBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,705
19,232
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » AFKMUD 2.1.4 - Magic.cpp Warn...
Forum Rules | Mark all | Recent Posts

AFKMUD 2.1.4 - Magic.cpp Warning
< Newer Topic :: Older Topic > Compiling : Magic.cpp Warning

Pages:<< prev 1 next >>
Post is unread #1 Sep 3, 2011, 6:42 am
Go to the top of the page
Go to the bottom of the page

HubWired
Fledgling
GroupMembers
Posts14
JoinedAug 23, 2011

Hi, everyone !
I've been reading the specs. of AFKMUD and I decided to get my Linux Fedora Core 4 back to one of my DELL PC. As you all know in previous posts I downloaded SmaugFuss 1.9 but as you have said AFKMUD has many other features allowing newbie and really Wizards to create Worlds more freely..
Compiling: It seems that "almost" everything went well, I even tested a little bit after compiled and ran.
***** The file MAGIC.CPP ***** is the one that gave me the Warning during compiling and it's the following:
magic.cpp: In function ‘void do_cast(char_data*, std::string)’:
magic.cpp
:1309: warning: ‘t’ may be used uninitialized in this function
.... A) What should I do ? "obviousely, it's pointing me out to line 1309 in file magic.cpp" . Even though, again it seems to run "o.k." I really want to make sure that the warning won't catch me with my "coconut head" souped up making my world I want then "ZAP !!!"
Thank you for your help...
God bless you all
Hubwired
       
Post is unread #2 Sep 6, 2011, 1:39 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

This warning is harmless. It just means the "t" variable hasn't been set to a default value before the first time it was called by the code.
       
Post is unread #3 Sep 6, 2011, 5:44 pm
Go to the top of the page
Go to the bottom of the page

HubWired
Fledgling
GroupMembers
Posts14
JoinedAug 23, 2011

Thank you, Samson
I know you guys are really busy with many other stuff...
I'm still in the reading stages of AFKMud's docs.
Thanks
Hubwired
       
Post is unread #4 Sep 7, 2011, 5:35 am   Last edited Sep 7, 2011, 5:40 am by Kayle
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

This isn't harmless. This could be pointing out a serious issue like the two times I've caught these while working on SmaugFUSS. The two times this has been seen in SmaugFUSS the variable really was completely uninitialized before it was used, this isn't just saying, you didn't set a default value. It could be saying, you're using this to display something without ever setting a value to begin with.

[Edit:] After looking at the code in question, you can get rid of the warning by changing:

timer_data *t;

to
timer_data *t = NULL;


That will silence the warning, and ensure that the code functions as it should.
       
Post is unread #5 Sep 7, 2011, 9:17 pm
Go to the top of the page
Go to the bottom of the page

HubWired
Fledgling
GroupMembers
Posts14
JoinedAug 23, 2011

Thanks a lot, Kayle
I'll do that ... :)
       
Post is unread #6 Sep 7, 2011, 9:45 pm
Go to the top of the page
Go to the bottom of the page

HubWired
Fledgling
GroupMembers
Posts14
JoinedAug 23, 2011

Just for the record. I did what you suggested Kayle ... :)
recompiled with no errors or pop ups, no WARNING from magic.cpp ... :)
so far so good... and of course it's running in my LAN
Thanks again to you all ... :)
Hubwired
       
Pages:<< prev 1 next >>