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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  SMAUG
. -> [Folder]  Compiling the server
. . -> [Subject]  Error with new cygwin

Error with new cygwin

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


Posted by Ardentcrest   (47 posts)  [Biography] bio
Date Wed 12 Sep 2018 07:10 AM (UTC)
Message
I'm getting this error with cygwin

 
$ make
make -s smaug
  Compiling o/imc.o....
imc.c: In function ‘void imc_update_tellhistory(CHAR_DATA*, const char*)’:
imc.c:1565:38: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
       if( IMCTELLHISTORY( ch, x ) == '\0' )
                                      ^~~~
make[1]: *** [Makefile:102: o/imc.o] Error 1
make: *** [Makefile:46: all] Error 2


any help
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 12 Sep 2018 02:17 PM (UTC)

Amended on Wed 12 Sep 2018 02:18 PM (UTC) by Nick Gammon

Message
\0 is really zero, so try replacing that with just 0.

- Nick Gammon

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

Posted by Ardentcrest   (47 posts)  [Biography] bio
Date Reply #2 on Wed 12 Sep 2018 05:22 PM (UTC)

Amended on Wed 12 Sep 2018 06:08 PM (UTC) by Ardentcrest

Message
that worked now getting this


  Compiling o/act_wiz.o....
act_wiz.c: In function ‘bool create_new_race(int, char*)’:
act_wiz.c:8824:6: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
 bool create_new_race( int rcindex, char *argument )
      ^~~~~~~~~~~~~~~
act_wiz.c:8834:12: note: ‘snprintf’ output between 1 and 17 bytes into a destination of size 16
    snprintf( race_table[rcindex]->race_name, 16, "%-.16s", argument );
    ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:102: o/act_wiz.o] Error 1
make: *** [Makefile:46: all] Error 2
[Go to top] top

Posted by Ardentcrest   (47 posts)  [Biography] bio
Date Reply #3 on Mon 17 Sep 2018 07:52 PM (UTC)
Message
Found out this Error is because of a bug in one of the GCC files.

I just removed the -Werror flag and it compiled fully after changing all "\0" with 0.
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #4 on Tue 18 Sep 2018 05:55 AM (UTC)
Message
That flag just makes warnings become errors. They always were warnings, but with that flags it won’t let you compile them.

The idea behind that is the warnings are there for a reason, and you may find that even though it compiles you may have run time issues.

- Nick Gammon

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

Posted by Ardentcrest   (47 posts)  [Biography] bio
Date Reply #5 on Tue 18 Sep 2018 06:05 AM (UTC)

Amended on Tue 18 Sep 2018 06:40 AM (UTC) by Ardentcrest

Message
This is a confirmed bug of "snprintf" in GCC 7 and 8

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80924

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78969

I believe Its just the warning coming up is the bug but the code should still work
[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.


14,731 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]