[Tux3] Question about 212c59f7565f

Michael Pattrick mpattrick at rhinovirus.org
Sat Aug 1 16:13:00 PDT 2009


Suppress idiotic gcc warning for constant shift on 32 bit arch
       1--- a/user/utility.h	Mon Jun 29 09:55:28 2009 +0900
       2+++ b/user/utility.h	Mon Jun 29 10:10:21 2009 -0700
       3@@ -19,11 +19,10 @@ static __always_inline unsigned long __f
       4 {
       5 	int num = 0;
       6
       7-	if (BITS_PER_LONG == 64)  {
       8-		if ((word & 0xffffffff) == 0) {
       9-			num += 32;
      10-			word >>= 32;
      11-		}
      12+	if (BITS_PER_LONG == 64 && !(word & 0xffffffff)) {
      13+		num += 32;
      14+		word >>= 16; /* work around idiotic gcc warning */
      15+		word >>= 16; /* work around idiotic gcc warning */
      16 	}
      17 	if ((word & 0xffff) == 0) {
      18 		num += 16;

As BITS_PER_LONG is a macro, wouldn't it make more scene to include
that as a preprocess directive to get rid of the compiler warning?


Michael Pattrick
http://www.rhinovirus.org/math

_______________________________________________
Tux3 mailing list
Tux3 at tux3.org
http://mailman.tux3.org/cgi-bin/mailman/listinfo/tux3



More information about the Tux3 mailing list