Project

General

Profile

Actions

Bug #5451

open

Many variables set but not used

Added by Gary Mills almost 7 years ago. Updated almost 7 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
tools - gate/build tools
Start date:
2014-12-20
Due date:
% Done:

0%

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

Description

gcc 4.8.2 generates a large number of these warnings in building illumos. This is a specific example:


../stabs.c: In function 'whitesp':
../stabs.c:267:8: error: variable 'orig' set but not used [-Werror=unused-but-set-variable]
char *orig, c;
^
cc1: all warnings being treated as errors

The correct solution is to remove the variable along with code that sets it. Otherwise, add this line:


CERRWARN += -_gcc=-Wno-unused-but-set-variable

to Makefile or Makefile.com, after the group of similar lines. All of these locations need fixing:


usr/src/tools/stabs/sparc
usr/src/uts/sun4u/genunix
usr/src/uts/sun4u/unix
usr/src/lib/libc/sparc
usr/src/lib/libc/sparcv9
usr/src/lib/libnsl
usr/src/lib/libresolv2
usr/src/lib/libadm
usr/src/lib/libm
usr/src/lib/libsocket
usr/src/lib/libnls
usr/src/lib/hbaapi
usr/src/lib/libnisdb
usr/src/lib/smhba
usr/src/lib/krb5/kadm5/srv
usr/src/lib/krb5/plugins/kdb/db2/libdb2
usr/src/lib/libtnfctl
usr/src/lib/madv
usr/src/lib/libxcurses
usr/src/lib/gss_mechs/mech_spnego
usr/src/lib/libsmedia/plugins
usr/src/lib/hal/libhal-storage
usr/src/lib/libima
usr/src/lib/efcode/engine/sparcv9
usr/src/lib/libprtdiag_psr/sparc
usr/src/uts/sparc/dca
usr/src/uts/sparc/mr_sas
usr/src/uts/sparc/hermon
usr/src/uts/sparc/dad
usr/src/uts/sparc/tavor
usr/src/uts/sparc/zfs
usr/src/uts/sun4u/upa64s
usr/src/uts/sun4u/sbus
usr/src/uts/sun4u/zs
usr/src/uts/sun4u/todmostek
usr/src/uts/sun4u/starfire/sbus
usr/src/uts/sun4v/genunix
usr/src/lib/libldap5
usr/src/lib/libast
usr/src/lib/libadutils
usr/src/lib/libsldap
usr/src/lib/libdns_sd
usr/src/lib/libcmd
usr/src/lib/gss_mechs/mech_krb5
usr/src/lib/libshell

Actions #1

Updated by Igor Kozhukhov almost 7 years ago

please pay attention:
CERRWARN += -_gcc=-Wno-unused-but-set-variable
will break gcc44 build

Actions #2

Updated by Gary Mills almost 7 years ago

Is there a way to add options that satisfy both the 4.4 and 4.8 compilers? Otherwise, the correct solution is to fix the underlying errors and remove the `-Wno-' options.

Actions #3

Updated by Igor Kozhukhov almost 7 years ago

we have to remove gcc warnings and i'm working on it with 'cmd' components(very slow process by one person).
no need options for different gcc versions - have to fix it.

Actions

Also available in: Atom PDF