<<< Date Index >>>     <<< Thread Index >>>

Re: Bug in Sun studio 11



Hi,

Thanks for all your opinions. I would like to submit it for second
consideration. Unfortunately I can't set the mycrc to zero, because the
workaround does not work then :)

-- 
        Vlad
diff -r 80bd3c060b8d hcache.c
--- a/hcache.c  Mon Jun 25 03:42:41 2007 +0200
+++ b/hcache.c  Mon Jun 25 22:56:58 2007 +0200
@@ -453,7 +453,17 @@ crc_matches(const char *d, unsigned int 
 crc_matches(const char *d, unsigned int crc)
 {
   int off = sizeof (validate);
+
+#if (__SUNPRO_C == 0x570 || __SUNPRO_C == 0x580) && defined(__i386)
+  /*
+   * This is workaround for bug in Sun compiler. Bug is present in SunStudio 10
+   * and 11; bug happens only on i386 platform. SunStudio 12 is not affected.
+   *  -- vlmarek@xxxxxxxx
+   */
+  static unsigned int mycrc;
+#else
   unsigned int mycrc = 0;
+#endif
 
   if (!d)
     return 0;