Project

General

Profile

Bug #5697

cleanup gcc warnings for cmd/nscd

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

Status:
In Progress
Priority:
Normal
Category:
cmd - userland programs
Start date:
2015-03-09
Due date:
% Done:

80%

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

Description

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_init.c 
nscd_init.c: In function '_nscd_refresh':
nscd_init.c:200:13: error: 'rc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  nscd_rc_t  rc;
             ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_init.o'

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_config.c 
nscd_config.c: In function '_nscd_cfg_prelim_check':
nscd_config.c:918:2: error: enumeration value 'NSCD_CFG_DATA_NONE' not handled in switch [-Werror=switch]
  switch (desc->type) {
  ^
nscd_config.c:918:2: error: enumeration value 'NSCD_CFG_DATA_BOOLEAN' not handled in switch [-Werror=switch]
nscd_config.c:918:2: error: enumeration value 'NSCD_CFG_DATA_PERCENT' not handled in switch [-Werror=switch]
nscd_config.c: In function '_nscd_cfg_str_to_data':
nscd_config.c:2345:2: error: enumeration value 'NSCD_CFG_DATA_NONE' not handled in switch [-Werror=switch]
  switch (desc->type) {
  ^
nscd_config.c:2345:2: error: enumeration value 'NSCD_CFG_DATA_STRING' not handled in switch [-Werror=switch]
nscd_config.c:2345:2: error: enumeration value 'NSCD_CFG_DATA_PERCENT' not handled in switch [-Werror=switch]
nscd_config.c: In function '_nscd_cfg_get_list':
nscd_config.c:92:18: error: 'l' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  nscd_cfg_id_t  *l;
                  ^
nscd_config.c: In function '_nscd_cfg_add_index_entry':
nscd_config.c:226:11: error: 'dbe_type' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  db_entry = _nscd_alloc_db_entry(dbe_type, (const char *)name,
           ^
nscd_config.c: In function '_nscd_cfg_init':
nscd_config.c:1237:12: error: 'j' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  int    i, j, datalen;
            ^
nscd_config.c: In function '_nscd_cfg_set':
nscd_config.c:2558:4: error: 'gdesc' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    _nscd_cfg_free_vlen_data_group(gdesc,
    ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_config.o'

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_dbimpl.c 
nscd_dbimpl.c: In function 'scan_hash':
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_ADD_DB_ENTRY_FIRST' not handled in switch [-Werror=switch]
     switch (option) {
     ^
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_ADD_DB_ENTRY_LAST' not handled in switch [-Werror=switch]
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_ADD_DB_ENTRY_REPLACE' not handled in switch [-Werror=switch]
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_ADD_DB_ENTRY_IF_NONE' not handled in switch [-Werror=switch]
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_DEL_FIRST_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_DEL_ALL_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:132:5: error: enumeration value 'NSCD_DEL_EXACT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c: In function '_nscd_add_db_entry':
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_GET_FIRST_DB_ENTRY' not handled in switch [-Werror=switch]
   switch (option) {
   ^
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_GET_NEXT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_GET_EXACT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_ADD_DB_ENTRY_LAST' not handled in switch [-Werror=switch]
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_DEL_FIRST_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_DEL_ALL_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:214:3: error: enumeration value 'NSCD_DEL_EXACT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c: In function '_nscd_delete_db_entry':
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_GET_FIRST_DB_ENTRY' not handled in switch [-Werror=switch]
   switch (option) {
   ^
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_GET_NEXT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_GET_EXACT_DB_ENTRY' not handled in switch [-Werror=switch]
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_ADD_DB_ENTRY_FIRST' not handled in switch [-Werror=switch]
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_ADD_DB_ENTRY_LAST' not handled in switch [-Werror=switch]
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_ADD_DB_ENTRY_REPLACE' not handled in switch [-Werror=switch]
nscd_dbimpl.c:315:3: error: enumeration value 'NSCD_ADD_DB_ENTRY_IF_NONE' not handled in switch [-Werror=switch]
nscd_dbimpl.c: In function '_nscd_alloc_db':
nscd_dbimpl.c:488:7: error: 'sz' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  int  sz;
       ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_dbimpl.o'

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_nswstate.c 
nscd_nswstate.c: In function '_nscd_free_nsw_state':
nscd_nswstate.c:53:5: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
  if (s->nsw_cfg_p != NULL)
     ^
nscd_nswstate.c: In function '_get_nsw_state_int':
nscd_nswstate.c:546:7: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
    if (!thread_only)
       ^
nscd_nswstate.c:570:7: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
    if (!thread_only)
       ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_nswstate.o'

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_switch.c 
nscd_switch.c: In function 'retry_test':
nscd_switch.c:68:5: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
  if (res == NSS_TRYAGAIN &&
     ^
nscd_switch.c:77:5: error: suggest explicit braces to avoid ambiguous 'else' [-Werror=parentheses]
  if (res == NSS_NISSERVDNS_TRYAGAIN &&
     ^
nscd_switch.c: In function '_nss_search':
nscd_switch.c:632:8: error: 'dbi' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  int   dbi, srci = -1;
        ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_switch.o'

+ /usr/gcc/4.9/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 -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 -D_REENTRANT -DSUN_THREADS -I../../lib/libc/port/gen -I../../lib/libc/inc -I../../lib/libsldap/common -c nscd_frontend.c 
In file included from nscd_frontend.c:48:0:
nscd_frontend.c: In function '_nscd_APP_check_cred':
nscd_log.h:84:5: error: 'euid' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     _nscd_logit
     ^
nscd_frontend.c:435:9: note: 'euid' was declared here
  uid_t  euid;
         ^
cc1: all warnings being treated as errors
*** Error code 1
dmake: Fatal error: Command failed for target `nscd_frontend.o'

#1

Updated by Igor Kozhukhov over 5 years ago

  • Status changed from New to In Progress
  • % Done changed from 50 to 80

Also available in: Atom PDF