<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
 <channel>
  <atom:link href="https://smaugmuds.afkmods.com/index.php?a=rssfeed&amp;t=4499" rel="self" type="application/rss+xml" />
  <title>SmaugMuds - Topic: gcc 4.4.3 and warnings</title>
  <link>https://smaugmuds.afkmods.com/index.php?a=rssfeed&amp;t=4499</link>
  <description>The largest Smaug community resource site. - Or how I learned to hate gcc</description>
  <language>en</language>
  <generator>SmaugMuds</generator>
  <ttl>60</ttl>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21252#p21252</link>
   <description>[quote=Sharmair]I have seen quite a number of places in MUD code that uses sprintf (or the like) when a strcpy would work better.[/quote] There&#039;s absolutely nothing wrong with using sprintf here, as long as it&#039;s invoked correctly (look at the second argument): [code] sprintf( victname, &amp;quot;%s&amp;quot;, IS_NPC( victim ) ? victim-&amp;gt;short_descr : race_table[victim-&amp;gt;race].race_name ); [/code] This is exactly what the compiler&#039;s warning says: The call to sprintf lacked the literal string containing format a</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21252#p21252</guid>
   <pubDate>Thu, 13 Jan 2011 03:09:41 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (Caius)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21251#p21251</link>
   <description>Thanks all for the help. Truly appreciate it. I&#039;ll poke about and try a few different things. And don&#039;t worry Aurin, I&#039;m actually pretty clueless when it comes to programming. I just muddle my way though and yell when I get stuck :D There are a few more places where I&#039;m seeing uninitialized values. I&#039;ll try to poke about and see what I can do now knowing what I&#039;m looking for. Sharmair, As to the strcpy/format warnings - I&#039;ll also poke them with a stick and see what happens. And thanks for</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21251#p21251</guid>
   <pubDate>Wed, 12 Jan 2011 15:50:15 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (ayuri)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21250#p21250</link>
   <description>definitely take Sharmair&#039;s advice over mine. *LOL*  I&#039;m more or less just starting, and trying to be helpful--when maybe I&#039;m not. :P</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21250#p21250</guid>
   <pubDate>Wed, 12 Jan 2011 07:50:31 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (Aurin)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21249#p21249</link>
   <description>As far as the first warning, like it was said before, the percent is never set to anything before it is used.  Global, static and heap memory that is allocated with calloc will in fact be initialized to NULL (0), but something on the stack like this will not be set to anything at all.  It will be whatever happens to be in that memory location when the function is entered, and that could be anything (thus the warning). In this case, as percent is only used in a math expression, and the res</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21249#p21249</guid>
   <pubDate>Wed, 12 Jan 2011 07:33:43 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (Sharmair)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21247#p21247</link>
   <description>In order to fix the percent thing, do the following: Somewhere above the ifcheck with &#039;percent&#039; in it, add the following: [code] percent = ch-&amp;gt;pcdata-&amp;gt;learned[gsn_bribe] [/code] I&#039;m sure Kayle could give a better explanation other than the fact that you never gave &#039;percent&#039; a value, which means the code uses NULL, which will crash the mud in this particular instance with the use of bribe, if it ever got past the compile sequence. heh</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21247#p21247</guid>
   <pubDate>Tue, 11 Jan 2011 23:29:34 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (Aurin)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21246#p21246</link>
   <description>With no time to probe the track thing I don&#039;t have an answer for that one, but the bribe bit is actually a legitimate bug. Percent is never set to anything. It really is uninitialized. When I get some time tomorrow, I&#039;ll sit down here and try and give you a better explanation, and have a look at the track thing.</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21246#p21246</guid>
   <pubDate>Tue, 11 Jan 2011 22:13:56 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (InfiniteAxis)</author>
  </item>
  <item>
   <title>gcc 4.4.3 and warnings</title>
   <link>https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21245#p21245</link>
   <description>So, greetings everyone! Been a while. Updated my host, brand spanking new gcc 4.4.3! Now, as you all can imagine some new warnings are popping up after the old ones were cleared out. I thought I&#039;d pick a few warnings and see what the community says. As far as I know, most of these functions should be fairly stock(?): swskills.c function do_bribe warning : &amp;quot;percent&amp;quot; may be used uninitialized in this function [code]void do_bribe ( CHAR_DATA *ch , char *argument ) { char arg1 [MAX_I</description>
   <guid isPermaLink="true">https://smaugmuds.afkmods.com/topic/gcc-443-and-warnings-4499/&amp;p=21245#p21245</guid>
   <pubDate>Mon, 10 Jan 2011 20:58:45 CST</pubDate>
   <category>SWFOTE FUSS</category>
   <author>nobody@example.com (ayuri)</author>
  </item>
 </channel>
</rss>
