Subject: bug#766: 23.0.60; interesting warning during compilation

From: Eli Zaretskii <[email-masked]>
Date: Sun, 24 Aug 2008 21:12:02 +0300

> Cc: [email-masked],
>  [email-masked]
> From: Peter Dyballa <[email-masked]>
> Date: Sun, 24 Aug 2008 09:27:16 +0200
> 
> 
> Am 24.08.2008 um 05:13 schrieb Eli Zaretskii:
> 
> > If you mean with sizeof, then the problem is that sizeof is not a
> > preprocessing-time operator, so it cannot prevent the compiler from
> > seeing the offending code.
> 
> You mean
> 
> 	if (sizeof (s.st_ino) > 4)
> 
> introducing the shift operation will fail to keep the compiler from  
> emitting the warning?

Yes, it will fail.  Please try compiling this toy program on a 32-bit
machine, and you will see the same warning.

    int foo (int a)
    {
      if (sizeof (a) > 4)
	return a >> 32;
      else
	return 0;
    }

> Anyway, I think Andreas Schwab's proposition to split the one wide  
> shift into two shorter ones is better.

I agree, I just wanted to be sure that this won't bring the same
warning back at some future time.