27 Jan, 2007, Guest wrote in the 1st comment:
Votes: 0
This is one of the common problems with compiling Rom in gcc4 due to tightening up what the compiler will let slip by as valid code. I originally posted this on MUD Planet.


Find these:

/* game tables */
extern const struct clan_type clan_table[MAX_CLAN];
extern const struct position_type position_table[];
extern const struct sex_type sex_table[];
extern const struct size_type size_table[];

/* flag tables */
extern const struct flag_type act_flags[];
extern const struct flag_type plr_flags[];
extern const struct flag_type affect_flags[];
extern const struct flag_type off_flags[];
extern const struct flag_type imm_flags[];
extern const struct flag_type form_flags[];
extern const struct flag_type part_flags[];
extern const struct flag_type comm_flags[];
extern const struct flag_type extra_flags[];
extern const struct flag_type wear_flags[];
extern const struct flag_type weapon_flags[];
extern const struct flag_type container_flags[];
extern const struct flag_type portal_flags[];
extern const struct flag_type room_flags[];
extern const struct flag_type exit_flags[];

These need to all be moved down to the end of the file, past the last struct that's defined here. Once you've moved them, all is well and your code will once again compile.
28 Jan, 2007, Omega wrote in the 2nd comment:
Votes: 0
i remember this problem when i updated my compiler to gcc4, it made me annoyed by the simplicity of the required update. although, good coding practices ensued, so its all good :)
29 Jan, 2007, Darmond wrote in the 3rd comment:
Votes: 0
first off yes i am still alive lol just got buisy got enguaged etc so I dont have as much time as I ust to.
secondly blagarglefangle gurgole *dead silence*
well I realy dislike GCC4 ya its better but now I cant compile my already unstabole buggy code >_< lol I knew those problems where three and I knew they eventualy needed to be fixed I didnt know how to fix them and was glad when the GCC over looked them before now i need to figure out how to fix them before I can go on and improve the rest of my mud *sighs* I am tempted to actualy go get a stock copy of rom and just rip out the good code I liked from mine… its going to be suck a pain though X_X if only I was a way better coder lol
29 Jan, 2007, Omega wrote in the 4th comment:
Votes: 0
just update your existing code, take the time, research the errors the compiler gives you, you'll be better off for it.

ripping the code from your existing base into a stock base will just move the problems over. besides, once your gcc4, you just have to maintain the standard, if your on a server that updates the compiler when there are major compiler updates, then your code will stay up to day with the gcc standards, because the new problems it gives you will be quickly fixed apposed to fixing an entire base all at once, it should just be the simple things.

Personaly, i converted to gcc4 and did a g++ conversion at the same time, talk about a headache their :P but my mud is running better then ever, and frankly, i like it this way.

So my suggestion to you is to just update your existing code, or post the warnings/errors the compiler is givin you here, and the community will aid you in fixing, thats what we're here for :)
29 Jan, 2007, Tijer wrote in the 5th comment:
Votes: 0
As Samson says, getting your mud GCC4 compliant involves doing exactly what he stated in the first post of this thread.

Apart from a few minor other tweaks, you should have your MUD code compiling after doing just that!
29 Jan, 2007, Omega wrote in the 6th comment:
Votes: 0
That is a good point Tijer, however, if he has siginificantly modified his mud, it may require more to make it gcc4 compatable.
29 Jan, 2007, Guest wrote in the 7th comment:
Votes: 0
Actually as I recall, for stock 2.4b6 all that it wanted was the structure externs moved to the bottom of tables.h. It didn't require anything more than that.

People have a common habit of saying the compiler is broken when their code will no longer compile. I don't know how many times I've seen this posted over the years. It happened back in the day when gcc 3 came out. People complained. Certain clueless bonehead hosts called it bugware and refused to install it, even a couple of years after the fact. It happened again when gcc4 came along and it still hasn't gained complete acceptance.

The code most of us use is old. Much of it was written back in the mid to late 90s. It's expected that a lot of it will have problems due to sloppiness. As compilers mature, the standards are tightened up, and it's better for all of us. Mud code just tends to prefer to remain static for some reason. :)
29 Jan, 2007, Justice wrote in the 8th comment:
Votes: 0
Heh, people have a tendency to let shit roll downhill… Kind of amuses me. I remember when my host upgraded to gcc4, annoyed me for a bit, but it really didn't take long to get it to compile again. There usually aren't many "types" of issues, so it's mostly repeatative work.
30 Jan, 2007, Darmond wrote in the 9th comment:
Votes: 0
lol well in my case I can guerentee its from slopyness funny thing is the code i have alteded and made myself works fine whats happened is all the extras I put in back when I was still realy crappy *as apost to just crappy* isent likething the GCC cas I had to cut a lot of corners to get it to work and dont rember what i did to alter it to make it work before. so I figure the best bet is to look at my list of improvements *i did keep one luckly* and just reinstall everything on a clean copy the right way so the whole thing is clean this time. also it gives me a chance to put in better code and ditch things like loups colour which I have found to take up more room then needed
16 Mar, 2007, Brinson wrote in the 10th comment:
Votes: 0
I want names.

Named of the bastards who did this to me ;).

I've corrected ohhh…about 100 errors and am nowhere near the end of the list its shooting at me since moving to a server with GCC4.

I'm not really a coder, I dabble in code…more of a tweaker…I'm at the point where I can install snippets and write some of my own (very)simple ones and this is driving me crazy.

I guess its like they say: What doesn't kill you makes you stronger. Just have to remember to walk AWAY from the light.
01 Mar, 2008, Kjwah wrote in the 11th comment:
Votes: 0
Had to go through this updating my friends code… It sucked, I hadn't done any programming for years and then he drops code in my face which didn't compile like it used to.. :p
10 Apr, 2009, Brinson wrote in the 12th comment:
Votes: 0
I did this to a piece of code with a few dozen errors and it got rid of all but two of them. Those two:

extern const struct ss_type ss_table [MAX_CLASS];
extern const struct ss_group_type ss_group_table [MAX_GROUPS];

are the only ones with problems.

Any idea why it would fix all but two?
10 Apr, 2009, David Haley wrote in the 13th comment:
Votes: 0
Please define "problems" to give us a starting point of where to look here…
10 Apr, 2009, Brinson wrote in the 14th comment:
Votes: 0
In file included from act_comm.c:29:
merc.h:5665: error: array type has incomplete element type
merc.h:5666: error: array type has incomplete element type
10 Apr, 2009, Sharmair wrote in the 15th comment:
Votes: 0
Brinson said:
In file included from act_comm.c:29:
merc.h:5665: error: array type has incomplete element type
merc.h:5666: error: array type has incomplete element type

This means the compiler has not seen a full definition of your array element types (in this
case struct ss_type and struct ss_group_type) when you try to declare the arrays. The
incomplete means it basically just knows there is such a type, but does not know the details
(the layout and such), this is enough to make pointers to the type, but not enough info to
make actual objects (the elements of the array in this case) as it does not know the size.
The fix is just to have the definition of the structs before you declare the arrays. It should
also be noted that the use of the struct type in these lines could very well be the incomplete
declaration themselves, and this might have compiled before as these are extern declarations
and not the actual definition, and the old compiler did not figure it needed the exact details
to just know there is such an array someplace else.
11 Apr, 2009, Hades_Kane wrote in the 16th comment:
Votes: 0
*hugs having his own VPS and deciding what compiler he runs*
28 Jan, 2010, triskaledia wrote in the 17th comment:
Votes: 0
Probably an idiot question… But how do you know if you're running a gcc4, and what're the perks of upgrading to it if you dont?
28 Jan, 2010, Crelin wrote in the 18th comment:
Votes: 0
gcc -v will tell you what version of gcc is set to standard…your Makefile is where you set the version of gcc to be used.
29 Jan, 2010, David Haley wrote in the 19th comment:
Votes: 0
Newer compiler versions are likely to fix bugs (although admittedly obscure ones), improve optimization, and add standards compliance. Depending on what kind of an upgrade you're talking about, they might include new standard library functions, or new GNU extensions.

It's relatively unlikely that you care as a typical MUD developer, to be honest. In fact, most of the warnings that the new compilers issue due to stricter standards compliance are hard to fix if you're not pretty well-tuned to what they mean.
29 Jan, 2010, Skol wrote in the 20th comment:
Votes: 0
If I remember right, didn't you have to move defines around in header files or something as well? To be compliant in GCC4 that is. There were a few things that were interesting.