Project

General

Profile

Bug #5279

cleanup gcc warning for cmd/ls

Added by Igor Kozhukhov almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
2014-11-01
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:

Description

+ /usr/gcc/4.8/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -D__sun -O -m32 -Wall -Wextra -Werror -Wno-missing-braces -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-unused-local-typedefs -std=gnu89 -fno-inline-small-functions -fno-inline-functions-called-once -fno-ipa-cp -DTEXT_DOMAIN="SUNW_OST_OSCMD" -D_TS_ERRNO -I/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/usr/include -D_FILE_OFFSET_BITS=64 -Wl,-Bdirect -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.noexstk -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.pagealign -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.noexdata -o ls ../ls.c -L/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/lib -L/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/usr/lib -lsec -lnvpair -lcmdutils -lcurses -lc 
../ls.c: In function 'main':
../ls.c:1099:30: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
   if (flist[i]->ltype == 'd' && dflg == 0 || fflg)
                              ^
../ls.c: In function 'pentry':
../ls.c:1271:5: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
  if (iflg)
     ^
../ls.c:1291:6: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
   if (oflg)
      ^
../ls.c:1297:6: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
   if (gflg)
      ^
../ls.c: In function 'rddir':
../ls.c:1564:33: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
        dentry->d_name[1] == '.' &&
                                 ^
cc1: all warnings being treated as errors
*** Error code 1

+ /usr/gcc/4.8/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -D__sun -O -m32 -Wall -Wextra -Werror -Wno-missing-braces -Wno-sign-compare -Wno-unknown-pragmas -Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds -Wno-unused-local-typedefs -std=gnu89 -fno-inline-small-functions -fno-inline-functions-called-once -fno-ipa-cp -DTEXT_DOMAIN="SUNW_OST_OSCMD" -D_TS_ERRNO -I/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/usr/include -D_FILE_OFFSET_BITS=64 -Wl,-Bdirect -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.noexstk -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.pagealign -Wl,-M/myshare/builds/ssd02/builds/dilos-illumos.update/usr/src/common/mapfiles/common/map.noexdata -o ls ../ls.c -L/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/lib -L/myshare/builds/ssd02/builds/dilos-illumos.update/proto/root_i386/usr/lib -lsec -lnvpair -lcmdutils -lcurses -lc 
../ls.c: In function 'pem':
../ls.c:1238:25: error: 'ncols' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  nrows = (lp - slp - 1) / ncols + 1;
                         ^
../ls.c: In function 'main':
../ls.c:1079:6: error: 'myinfo' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if ((ep = gstat((*argv[optind] ? argv[optind] : dotp),
      ^
cc1: all warnings being treated as errors
*** Error code 1

History

#1

Updated by Igor Kozhukhov almost 6 years ago

  • % Done changed from 80 to 90
#2

Updated by Igor Kozhukhov almost 6 years ago

  • Status changed from In Progress to Pending RTI
  • % Done changed from 90 to 100
#3

Updated by Electric Monk almost 6 years ago

  • Status changed from Pending RTI to Closed

git commit 29e6ab979fdbd9d598f44c73c34496040e817685

commit  29e6ab979fdbd9d598f44c73c34496040e817685
Author: Igor Kozhukhov <ikozhukhov@gmail.com>
Date:   2014-11-11T05:21:25.000Z

    5279 cleanup gcc warning for cmd/ls
    Reviewed by: Gary Mills <gary_mills@fastmail.fm>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Approved by: Robert Mustacchi <rm@joyent.com>

Also available in: Atom PDF