coreutils
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] maint: accommodate gcc's -Wstrict-overflow option


From: Pádraig Brady
Subject: Re: [PATCH 1/2] maint: accommodate gcc's -Wstrict-overflow option
Date: Fri, 27 May 2011 00:40:42 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

Here's another change needed on my gcc 4.5 system

commit 8a26bccb467a3b22e5d894234c4b4a5c337294d4
Author: Pádraig Brady <address@hidden>
Date:   Fri May 27 00:39:55 2011 +0100

    maint: fix a -Wstrict-overflow build failure with gcc 4.5

    * src/ls.c (print_color_indicator): Avoid the warning by
    not decrementing the integer.

diff --git a/src/ls.c b/src/ls.c
index 96a9c4c..1c8d0d8 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4132,7 +4132,7 @@ print_color_indicator (const struct fileinfo *f, bool 
symlink_target)
     {
       name = f->linkname;
       mode = f->linkmode;
-      linkok = f->linkok - 1;
+      linkok = f->linkok ? 0 : -1;
     }
   else
     {



reply via email to

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