Project

General

Profile

Bug #5424

cleanup gcc warning for cmd/audit*

Added by Igor Kozhukhov over 5 years ago. Updated over 5 years ago.

Status:
In Progress
Priority:
Normal
Category:
cmd - userland programs
Start date:
2014-12-10
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

auditconfig.c: In function 'parse_args':
auditconfig.c:486:56: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
    if (*++argv == NULL || strcmp(*argv, "active") != 0 &&
                                                        ^
cc1: all warnings being treated as errors

History

#1

Updated by Igor Kozhukhov over 5 years ago

  • Category set to cmd - userland programs
auditconfig.c: In function 'do_getclass':
auditconfig.c:1293:13: error: 'event_number' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  au_event_t event_number;
             ^
auditconfig.c: In function 'do_setclass':
auditconfig.c:1921:15: error: 'event' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  ec.ec_number = event;
               ^
cc1: all warnings being treated as errors

auditd.c: In function 'init_plugin':
auditd.c:574:19: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
  if (list != NULL && p->plg_kvlist == NULL || p->plg_path == NULL) {
                   ^
cc1: all warnings being treated as errors

doorway.c: In function 'report_error':
doorway.c:186:2: error: case value '4294967293' not in enumerated type 'auditd_rc_t' [-Werror=switch]
  case INTERNAL_CONFIG_ERROR:
  ^
doorway.c:181:2: error: case value '4294967294' not in enumerated type 'auditd_rc_t' [-Werror=switch]
  case INTERNAL_SYS_ERROR:
  ^
doorway.c:176:2: error: case value '4294967295' not in enumerated type 'auditd_rc_t' [-Werror=switch]
  case INTERNAL_LOAD_ERROR:
  ^
cc1: all warnings being treated as errors

proc.c: In function 'get_recs':
proc.c:540:23: error: 'ret2' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (ret < 0 || ret2 == -2) {
                       ^
proc.c:507:18: error: 'secs' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    pcb->pcb_time = secs; /* time of record */
                  ^
proc.c: In function 'check_rec':
proc.c:775:6: error: 'tv.tv_sec' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (m_before <= tv.tv_sec)
      ^
cc1: all warnings being treated as errors

token.c: In function 'return_value32_token':
token.c:263:23: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
  if ((flags & M_SORF) &&
                       ^
token.c: In function 'return_value64_token':
token.c:285:23: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
  if ((flags & M_SORF) &&
                       ^
cc1: all warnings being treated as errors

auditstat.c:121:29: error: unknown type name 'cnt'
 display_stats(au_stat_t *s, cnt)
                             ^
auditstat.c:62:13: error: 'display_stats' used but never defined [-Werror]
 static void display_stats();
             ^
cc1: all warnings being treated as errors

+ /usr/gcc/4.8/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -D__sun -fno-strict-aliasing -fno-unit-at-a-time -fno-optimize-sibling-calls -O2 -m64 -mtune=opteron -Ui386 -U__i386 -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.lx/proto/root_i386/usr/include -c aconf.c 
aconf.c: In function 'aconf_save':
aconf.c:326:6: error: 'tx_result' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  int tx_result;
      ^
aconf.c:362:25: error: 'tx' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  scf_transaction_destroy(tx);
                         ^
aconf.c: In function 'aconf_get_string':
aconf.c:471:19: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  scf_value_destroy(value);
                   ^
aconf.c: In function 'aconf_get_bool':
aconf.c:500:19: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  scf_value_destroy(value);
                   ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `aconf.o'

+ /usr/gcc/4.8/bin/gcc -fident -finline -fno-inline-functions -fno-builtin -fno-asm -fdiagnostics-show-option -nodefaultlibs -D__sun -fno-strict-aliasing -fno-unit-at-a-time -fno-optimize-sibling-calls -O2 -m64 -mtune=opteron -Ui386 -U__i386 -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.lx/proto/root_i386/usr/include -c utils.c 
utils.c: In function 'verify_exacct_file':
utils.c:233:31: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
        (!(c == EXD_GROUP_PROC && type == AC_PROC ||
                               ^
utils.c:235:28: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
        c == EXD_GROUP_FLOW && type == AC_FLOW ||
                            ^
utils.c:239:39: error: suggest parentheses around '&&' within '||' [-Werror=parentheses]
        c == EXD_GROUP_NET_FLOW_STATS) &&
                                       ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `utils.o'

Also available in: Atom PDF