[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  Bringing Smaug1.4a to gcc v4.2.4 standards

Bringing Smaug1.4a to gcc v4.2.4 standards

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Rash   United Kingdom  (56 posts)  [Biography] bio
Date Thu 04 Feb 2010 06:02 PM (UTC)
Message
I'm not quite sure if this should fall under Compiling or Coding but since it's compile errors and relates to gcc v4.2.4 I thought here may be best.

Here's some of the error's (There is quite a few). This set is just from comm.c


gcc -c  -g3 -Wall    -Ddwc  -DTIMEFORMAT  comm.c
comm.c: In function turn_on_mxp:
comm.c:364: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c: In function new_descriptor:
comm.c:863: warning: pointer targets in passing argument 3 of accept differ in signedness
comm.c: In function read_from_buffer:
comm.c:1206: warning: pointer targets in assignment differ in signedness
comm.c:1209: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1213: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1213: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1213: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1216: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1220: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1220: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c:1220: warning: pointer targets in passing argument 1 of strlen differ in signedness
comm.c: In function flush_buffer:
comm.c:1369: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c: In function nanny:
comm.c:1849: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:1883: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:1941: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2075: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2086: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2101: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2117: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2135: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2152: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2172: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2192: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness
comm.c:2669: warning: pointer targets in passing argument 2 of write_to_buffer differ in signedness


Here's Line 364-372. Line pointed to is in Bold.

/* set up MXP */
void turn_on_mxp (DESCRIPTOR_DATA *d)
  {
  d->mxp = TRUE;  /* turn it on now */
 	write_to_buffer( d, start_mxp_str, 0 );
	write_to_buffer( d, MXPMODE (6), 0 );   /* permanent secure mode */
  write_to_buffer( d, MXPTAG ("!-- Set up MXP elements --"), 0);
  /* Exit tag */
  write_to_buffer( d, MXPTAG ("!ELEMENT Ex '<send>' FLAG=RoomExit"), 0);
  /* Room Set Up tag ===== - Rash */
  write_to_buffer( d, MXPTAG ("!ELEMENT rl '<send>' FLAG=RoomLine"), 0);
  /* Room description tag */
  write_to_buffer( d, MXPTAG ("!ELEMENT rdesc '<p>' FLAG=RoomDesc"), 0);


Here's lines 860-871. Line pointed to is in Bold.

void new_descriptor( int new_desc )
{
    char buf[MAX_STRING_LENGTH];
    DESCRIPTOR_DATA *dnew;
    struct sockaddr_in sock;
    struct hostent *from;
    int desc;
    int size;
    char bugbuf[MAX_STRING_LENGTH];
#ifdef WIN32
    unsigned long arg = 1;
#endif


There's two to start. Perhaps someone can link me to a document on just how much stricter gcc v4 now is or something that may help?

Thanks, Rash
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Thu 04 Feb 2010 06:37 PM (UTC)
Message
Quote:
write_to_buffer( d, start_mxp_str, 0 );

This one is easy enough, the warning is telling you that the function expects signed or unsigned char* whereas you're giving it the opposite. I.e., it takes signed and you're giving it unsigned, or it takes unsigned and you're giving it signed.

Quote:
DESCRIPTOR_DATA *dnew;

This cannot be the right line because the warning message refers to a call to 'accept' but clearly there is none here.
The line numbers can get confused if your file mixes Unix and Windows line endings; try running 'dos2unix' on the file in question to see if that fixes the line numbers.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Thu 04 Feb 2010 08:00 PM (UTC)
Message
Are you using SmaugFUSS? That fixes a lot of bugs and compiles under gcc 4.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


13,638 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]