bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#766: 23.0.60; interesting warning during compilation


From: Stefan Monnier
Subject: bug#766: 23.0.60; interesting warning during compilation
Date: Wed, 03 Sep 2008 14:47:14 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

>> > If someone has suggestions how to avoid this warning without making
>> > code ugly and unreadable, and preferably without system-dependent
>> > #ifdef's, I'm all ears.
>> 
>> EMACS_INT high_ino = s.st_ino >> 31 >> 1;

> Thanks.  Can we be reasonably sure that GCC will not become smart
> enough some day to flag this as well?

I don't think anybody can guarantee it, but usually it's a bad idea to
output warnings about post-optimization code, so you may hope that GCC
will optimize "x >> 31 >> 1" to "x >> 32" without ever outputing
a warning about the silliness of the end result.

Then again, the present code shows that even outputting a warning about
"x >> 32" is already borderline annoying, so there's no guarantee gcc
won't become more annoying in the future.


        Stefan







reply via email to

[Prev in Thread] Current Thread [Next in Thread]