]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(print_long_format): Multiply the shift width by zero
authorJim Meyering <jim@meyering.net>
Fri, 10 Aug 2001 08:13:03 +0000 (08:13 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 10 Aug 2001 08:13:03 +0000 (08:13 +0000)
to avoid a warning from gcc on hosts with an unsigned type for the
st_size member.

src/ls.c

index dbbac57b2df5e6672f8a922c36532cb2c72357fa..ec730d892b8b466b8c70dedd3237c898fac3682f 100644 (file)
--- a/src/ls.c
+++ b/src/ls.c
@@ -2644,7 +2644,11 @@ print_long_format (const struct fileinfo *f)
         are actually positive values that have wrapped around.  */
       if (sizeof f->stat.st_size < sizeof size)
        size += ((uintmax_t) (f->stat.st_size < 0)
-                << (sizeof f->stat.st_size * CHAR_BIT));
+                << (sizeof f->stat.st_size * CHAR_BIT
+                    /* This final term has no effect other than to suppress
+                       a warning about the shift count being larger than the
+                       width of the type.  */
+                    * (sizeof f->stat.st_size < sizeof size)));
 
       sprintf (p, "%8s ",
               human_readable (size, hbuf, 1,