Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
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
Users Online
CommonCrawl, Yandex, Yahoo!

Members: 0
Guests: 13
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » AFKMud compile errors
Forum Rules | Mark all | Recent Posts

AFKMud compile errors
< Newer Topic :: Older Topic > Eeeek... storage not defined?

Pages:<< prev 1 next >>
Post is unread #1 Feb 23, 2003, 8:08 am   Last edited Nov 24, 2007, 1:20 am by Samson
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

*snip*
$ make clean
rm -f o/*.o afkmud core resolver resolver.o
make all
make[1]: Entering directory `/home/neomud/testserv/afkmud/src'
make -s afkmud
make[2]: Entering directory `/home/neomud/testserv/afkmud/src'
  Compiling o/i3.o....
i3.c: In function `I3_loop':
i3.c:6812: storage size of `null_time' isn't known
cc1: warnings being treated as errors
i3.c:6812: warning: unused variable `null_time'
make[2]: *** [o/i3.o] Error 1
make[2]: Leaving directory `/home/neomud/testserv/afkmud/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/neomud/testserv/afkmud/src'
make: *** [clean] Error 2


I've been trying to sort this one out for a while...
Any suggestions? I have a feeling it's something to do with my server's configuration. I BELIEVE it's RedHat. I've been pecking all over kyndig.com's site and server for version info...;)
       
Post is unread #2 Feb 23, 2003, 9:51 am   Last edited Nov 24, 2007, 1:21 am by Samson
Go to the top of the page
Go to the bottom of the page

Guest - (Unregistered)

*snip*
make[2]: Entering directory `/home/neomud/testserv/afkmud/src'
 Compiling o/i3.o....
i3.c: In function `I3_loop':
i3.c:6812: storage size of `null_time' isn't known
cc1: warnings being treated as errors
i3.c:6812: warning: unused variable `null_time'

I've been trying to sort this one out for a while...
Any suggestions? I have a feeling it's something to do with my server's configuration. I BELIEVE it's RedHat. I've been pecking all over kyndig.com's site and server for version info...;)

Ugh... okay I have met this before it may be the same reason or not, but it may be worth a look. Samson can prolly tell me if I'm on the right track or not more quickly.. I'm afriad this may sound a bit more complex than it really is, in which case e-mail me (the forum's know how to get ahold of me) or something or I'll talk to Samson about it.

Its attempting to work out the size of the variable type that null_time is (I'm assuming its a struct of some sort as thats the prob I had before). The problem occurs where its created from a transitory struct decleration not an inline something along the lines of

typedef struct
{
   char *field1;
   int field2;
   ...
   char field3[1024];
} blah;


Now this creates a variable blah structured as the struct exists, but it has no defined type to refer to. If you asked C what "blah" was it would say "a structure defined as..." whereas if I did this..

typedef struct blah_type
{
   char *field1;
   int field2;
   ...
   char field3[1024];
} blah;


And asked C what "blah" is it could happily say "blah_type" as I have a defined name structure referred to in the code and the symbol table (or wherever it keeps these things).

The first method is a shortcut of making a structure quickly without a type if you don't intend to use it heavily or just want to store stuff in it, while the second is more complete. When you ask for the sizeof(blah), the first example it doesn't exactly know what blah is and thus turns around and says "I dunno, as I dunno what it is really" yet in the second example you are effectively asking for the sizeof(blah_type) when you ask for the sizeof(blah).

Now I may not be exactly right, but I had a adjust IMC2 client code for this exact reason (Samson if you read this and want to see, in imc.h in your dist look at the struct for imc_event/_imc_event which I modded and the others like imc_vinfo) as I tried to interact with a struct and it had no idea what its size was, once I gave it a name it was happy again.

Until I get a chance to look at the I3 code to check I can't say for certain this is the reason, if I find out either way I'll post (unless someone else beats me to it ;) )

As to why, that depends what null_time is, and where its declared, how etc... it may have something to do with OS, it may not. I can't say for sure atm. I have a feeling null_time may be a system datatype then I believe its probably more likely a decleration issue (possibly). Either way right this min I have no way to look at the code.
       
Post is unread #3 Mar 7, 2003, 8:01 pm   Last edited Nov 24, 2007, 1:21 am by Samson
Go to the top of the page
Go to the bottom of the page

Xorith
The Null Value
GroupAFKMud Team
Posts254
JoinedFeb 23, 2003

I've been going over the code now that I've resettled into my mother's house. :P

When I disable I3 support in the Make File, I get this now:

[neomud@slayer src]$ make clean
rm -f o/*.o afkmud core resolver resolver.o
make all
make[1]: Entering directory `/home/neomud/testserv/afkmud/src'
make -s afkmud
make[2]: Entering directory `/home/neomud/testserv/afkmud/src'
  Compiling o/websvr.o....
websvr.c:319: variable `ZERO_TIME' has initializer but incomplete type
cc1: warnings being treated as errors
websvr.c:319: warning: excess elements in struct initializer after `ZERO_TIME'
websvr.c:319: warning: excess elements in struct initializer after `ZERO_TIME'
make[2]: *** [o/websvr.o] Error 1
make[2]: Leaving directory `/home/neomud/testserv/afkmud/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/neomud/testserv/afkmud/src'
make: *** [clean] Error 2
[neomud@slayer src]$


So i did some digging...

[neomud@slayer src]$ grep timeval *.*
comm.c: static struct timeval null_time;
comm.c:   struct timeval          last_time;
comm.c:     struct timeval now_time;
comm.c:         struct timeval stall_time;
comm.c:   struct timeval now_time;
i3.c:/*   static struct timeval null_time; */
i3.c:   static struct timeval null_time;
interp.c:void subtract_times( struct timeval *endtime, struct timeval *starttime
 );
interp.c:void start_timer(struct timeval *starttime)
interp.c:time_t end_timer(struct timeval *starttime)
interp.c:  struct timeval etime;
interp.c:    struct timeval time_used;
interp.c:  struct timeval starttime;
interp.c:  struct timeval endtime;
magic.c:void start_timer( struct timeval *starttime );
magic.c:time_t end_timer( struct timeval *endtime );
magic.c:    struct timeval time_used;
magic.c:    struct timeval time_used;
new_auth.c:   struct timeval starttime;
new_auth.c:   struct timeval starttime;
new_auth.c:   struct timeval starttime;
skills.c:void start_timer( struct timeval *starttime );
skills.c:time_t end_timer( struct timeval *endtime );
skills.c:    struct timeval time_used;
skills.c:    struct timeval time_used;
update.c:void subtract_times( struct timeval *endtime, struct timeval *starttime
 )
update.c:    struct timeval sttime;
update.c:    struct timeval entime;
websvr.c:struct timeval ZERO_TIME = { 0, 0 };
[neomud@slayer src]$


What I see in common with both is timeval. Now wether or not this is the root of my issue remains to be seen...

I checked up on null_time - Smaug's stock uses it in comm.c as well, as does afkmud in the same manner. My guess is the include file time.h brings it into play.

I disabled the webserver... then recompiled.

[neomud@slayer src]$ make clean
rm -f o/*.o afkmud core resolver resolver.o
make all
make[1]: Entering directory `/home/neomud/testserv/afkmud/src'
make -s afkmud
make[2]: Entering directory `/home/neomud/testserv/afkmud/src'
  Compiling o/act_comm.o....
**(snipping out spam)**
  Compiling o/comm.o....
**(snipping out spam)**
  Compiling o/magic.o....
magic.c: In function `do_cast':
magic.c:1159: storage size of `time_used' isn't known
cc1: warnings being treated as errors
magic.c:1159: warning: unused variable `time_used'
magic.c: In function `obj_cast_spell':
magic.c:1691: storage size of `time_used' isn't known
magic.c:1691: warning: unused variable `time_used'
make[2]: *** [o/magic.o] Error 1
make[2]: Leaving directory `/home/neomud/testserv/afkmud/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/neomud/testserv/afkmud/src'
make: *** [clean] Error 2
[neomud@slayer src]$


So you see it there... comm.c compiled nicely, per usual. Yet another error pops up though. This time in magic.c... Alright then... grep is your friend!

[neomud@slayer src]$ grep time_used *.*
interp.c:    struct timeval time_used;
interp.c:    start_timer(&time_used);
interp.c:    end_timer(&time_used);
interp.c:    tmptime = UMIN(time_used.tv_sec,19) * 1000000 + time_used.tv_usec;
interp.c:               ch->in_room ? ch->in_room->vnum : 0, time_used.tv_sec, t
ime_used.tv_usec );
magic.c:    struct timeval time_used;
magic.c:           start_timer(&time_used);
magic.c:           end_timer(&time_used);
magic.c:    struct timeval time_used;
magic.c:    start_timer(&time_used);
magic.c:    end_timer(&time_used);
skills.c:    struct timeval time_used;
skills.c:       start_timer(&time_used);
skills.c:       end_timer(&time_used);
skills.c:    start_timer(&time_used);
skills.c:    end_timer(&time_used);
skills.c:    struct timeval time_used;
skills.c:       start_timer( &time_used );
skills.c:       end_timer( &time_used );
skills.c:   start_timer( &time_used );
skills.c:   end_timer( &time_used );
[neomud@slayer src]$


Yet another 'timeval' defined variable. This is starting to build a pattern here.

After some checking I found that the include in magic.c was surrounded by an ifdef - and the line #include was never included in magic.c... It WAS, however, included in comm.c!

Aha! So there is the root of the issue. Apparently I might be using FreeBSD then, though it doesn't *seem* like it. ;)

Thanks for the help and support... This post was written as I went through the steps. hehe... may it serve as a guide for anyone else with the same issues.
       
Post is unread #4 Mar 8, 2003, 4:46 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

One should then note that if you are running FreeBSD, there's a Makefile that's been tailored for it and you should simply be using that. More than likely would have solved much of your problem
       
Pages:<< prev 1 next >>