The Dawn Of Time
The Official Forums for the Dawn Of Time Mud Codebase
 
Log in Register FAQ Memberlist Search The Dawn Of Time Forum Index Goto the Official Dawn Website

Centos 6.7 make error

 
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Getting Started
View previous topic :: View next topic  
Author Message
orrden



Joined: 04 Jun 2016
Posts: 1

PostPosted: Sat Jun 04, 2016 4:31 pm    Post subject: Centos 6.7 make error Reply with quote

Been running into a few make errors. Generally I've followed previous guides built for fedorra to fix them, and it's worked to a degree. But I'm running into this error now...

Code:

[root@host /home/rpgchaz/RoI/dot/src]# gmake
g++ -c -Wall -g -O  -Wno-write-strings db.cpp -o obj/db.o
db.cpp: In function âvoid assign_area_vnum(int)â:
db.cpp:1453: warning: suggest explicit braces to avoid ambiguous âelseâ
db.cpp: In function âvoid fix_mobprogs()â:
db.cpp:2460: error: cast from âmprog_code*â to âvn_intâ loses precision
db.cpp:2466: error: cast from âmprog_code*â to âvn_intâ loses precision
db.cpp:2475: error: cast from âmprog_code*â to âvn_intâ loses precision
db.cpp: In function âvoid fread_to_eol(FILE*)â:
db.cpp:3769: warning: suggest parentheses around â&&â within â||â
db.cpp: In function âvoid do_areasalpha(char_data*, char*)â:
db.cpp:4137: warning: suggest parentheses around â&&â within â||â
db.cpp: In function âvoid do_areas(char_data*, char*)â:
db.cpp:4221: warning: suggest parentheses around â&&â within â||â
gmake: *** [db.o] Error 1


Not quite sure what to edit. I know it has something to do with Prog not liking vn_int but thats about as far as I've gotten.

Any suggestions?[/code]


Back to top
View user's profile Send private message
Daos



Joined: 29 Jan 2003
Posts: 1214
Location: United States

PostPosted: Tue Jun 07, 2016 10:15 pm    Post subject: Reply with quote

Is this error from the stock dawn code, or did you add any modifications to it?

That warning in particular stems from compiler warning flag called:

-Wdangling-else

The purpose of the flag is to warn the coder about constructions where there may be confusion to which if statement an else branch belongs. Here is an example of such a case:

Code:
{
            if (a)
              if (b)
                foo ();
            else
              bar ();
          }


In c/c++, every else branch belongs to the innermost possible if statement, which in this example is if (b). This is often not what the coder expected, as illustrated in the above example by indentation the coder chose. When there is the potential for this confusion, GCC issues a warning when this flag is specified. To eliminate the warning, add explicit braces around the innermost if statement so there is no way the else can belong to the enclosing if. The resulting code looks like this:

Code:
{
            if (a)
              {
                if (b)
                  foo ();
                else
                  bar ();
              }
          }


Good luck.



_________________
- Daos

http://www.dawnoftime.org
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    The Dawn Of Time Forum Index » Getting Started All times are GMT + 13 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001-2005 phpBB Group
Theme created by Vjacheslav Trushkin