summaryrefslogtreecommitdiff
path: root/usr/src/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd')
-rw-r--r--usr/src/cmd/abi/appcert/static_prof/Makefile.com4
-rw-r--r--usr/src/cmd/abi/spectrans/parser/Makefile.targ8
-rw-r--r--usr/src/cmd/abi/spectrans/spec2map/Makefile.targ5
-rw-r--r--usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ8
-rw-r--r--usr/src/cmd/acct/Makefile5
-rw-r--r--usr/src/cmd/acct/lib/Makefile5
-rw-r--r--usr/src/cmd/acctadm/Makefile2
-rw-r--r--usr/src/cmd/addbadsec/Makefile2
-rw-r--r--usr/src/cmd/allocate/Makefile5
-rw-r--r--usr/src/cmd/amt/Makefile.com6
-rw-r--r--usr/src/cmd/ast/msgcc/Makefile4
-rw-r--r--usr/src/cmd/audio/audioctl/Makefile1
-rw-r--r--usr/src/cmd/audio/audioplay/Makefile5
-rw-r--r--usr/src/cmd/audio/audiorecord/Makefile4
-rw-r--r--usr/src/cmd/audio/utilities/Makefile3
-rw-r--r--usr/src/cmd/auditconfig/Makefile2
-rw-r--r--usr/src/cmd/auditd/Makefile2
-rw-r--r--usr/src/cmd/auditreduce/Makefile3
-rw-r--r--usr/src/cmd/auditstat/Makefile2
-rw-r--r--usr/src/cmd/auths/Makefile4
-rw-r--r--usr/src/cmd/autopush/Makefile4
-rw-r--r--usr/src/cmd/avs/dsbitmap/Makefile3
-rw-r--r--usr/src/cmd/avs/dscfg/Makefile4
-rw-r--r--usr/src/cmd/avs/dscfglockd/Makefile3
-rw-r--r--usr/src/cmd/avs/dsstat/Makefile8
-rw-r--r--usr/src/cmd/avs/dsw/Makefile5
-rw-r--r--usr/src/cmd/avs/errgen/Makefile1
-rw-r--r--usr/src/cmd/avs/ncall/Makefile3
-rw-r--r--usr/src/cmd/avs/rdc/Makefile5
-rw-r--r--usr/src/cmd/avs/sdbc/Makefile3
-rw-r--r--usr/src/cmd/awk/Makefile10
-rw-r--r--usr/src/cmd/awk_xpg4/Makefile5
-rw-r--r--usr/src/cmd/backup/Makefile.backup5
-rw-r--r--usr/src/cmd/backup/dump/Makefile5
-rw-r--r--usr/src/cmd/backup/lib/Makefile6
-rw-r--r--usr/src/cmd/bart/Makefile6
-rw-r--r--usr/src/cmd/bc/Makefile6
-rw-r--r--usr/src/cmd/bdiff/Makefile5
-rw-r--r--usr/src/cmd/beadm/Makefile1
-rw-r--r--usr/src/cmd/bfs/Makefile5
-rw-r--r--usr/src/cmd/bnu/Makefile.inc12
-rw-r--r--usr/src/cmd/boot/bootadm/Makefile4
-rw-r--r--usr/src/cmd/boot/common/mboot_extra.c9
-rw-r--r--usr/src/cmd/boot/common/mboot_extra.h3
-rw-r--r--usr/src/cmd/boot/installboot/Makefile1
-rw-r--r--usr/src/cmd/boot/installboot/installboot.c9
-rw-r--r--usr/src/cmd/boot/installboot/installboot.h2
-rw-r--r--usr/src/cmd/boot/installgrub/Makefile3
-rw-r--r--usr/src/cmd/boot/installgrub/installgrub.c8
-rw-r--r--usr/src/cmd/boot/installgrub/installgrub.h2
-rw-r--r--usr/src/cmd/boot/mbr/Makefile4
-rw-r--r--usr/src/cmd/cal/Makefile5
-rw-r--r--usr/src/cmd/calendar/Makefile4
-rw-r--r--usr/src/cmd/captoinfo/Makefile3
-rw-r--r--usr/src/cmd/cdrw/Makefile4
-rw-r--r--usr/src/cmd/chmod/Makefile6
-rw-r--r--usr/src/cmd/cmd-crypto/cryptoadm/Makefile2
-rw-r--r--usr/src/cmd/cmd-crypto/decrypt/Makefile.com5
-rw-r--r--usr/src/cmd/cmd-crypto/digest/Makefile.com4
-rw-r--r--usr/src/cmd/cmd-crypto/pktool/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/lib/nwamd/Makefile5
-rw-r--r--usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile5
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/chat/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile7
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/nc/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/nca/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile5
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile8
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/talk/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile8
-rw-r--r--usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile6
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile5
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/Makefile9
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile8
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile8
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile4
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile1
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile6
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile2
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile9
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile3
-rw-r--r--usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile6
-rw-r--r--usr/src/cmd/compress/Makefile5
-rw-r--r--usr/src/cmd/consadm/Makefile.com1
-rw-r--r--usr/src/cmd/cpc/cpustat/Makefile1
-rw-r--r--usr/src/cmd/cpio/Makefile2
-rw-r--r--usr/src/cmd/cron/Makefile5
-rw-r--r--usr/src/cmd/cron/cron.c2
-rw-r--r--usr/src/cmd/cron/cron.h10
-rw-r--r--usr/src/cmd/cron/funcs.c4
-rw-r--r--usr/src/cmd/csh/i386/Makefile10
-rw-r--r--usr/src/cmd/csh/sparc/Makefile10
-rw-r--r--usr/src/cmd/csplit/Makefile5
-rw-r--r--usr/src/cmd/ctrun/Makefile6
-rw-r--r--usr/src/cmd/ctstat/Makefile3
-rw-r--r--usr/src/cmd/ctwatch/Makefile5
-rw-r--r--usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile2
-rw-r--r--usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile1
-rw-r--r--usr/src/cmd/date/date.c4
-rw-r--r--usr/src/cmd/dc/Makefile6
-rw-r--r--usr/src/cmd/dcs/sparc/sun4u/Makefile2
-rw-r--r--usr/src/cmd/dd/Makefile3
-rw-r--r--usr/src/cmd/deroff/Makefile6
-rw-r--r--usr/src/cmd/devctl/Makefile3
-rw-r--r--usr/src/cmd/devfsadm/Makefile.com4
-rw-r--r--usr/src/cmd/devinfo/Makefile3
-rw-r--r--usr/src/cmd/devmgmt/cmds/Makefile7
-rw-r--r--usr/src/cmd/dfs.cmds/dfshares/Makefile7
-rw-r--r--usr/src/cmd/dfs.cmds/general/Makefile6
-rw-r--r--usr/src/cmd/dfs.cmds/sharectl/Makefile.com4
-rw-r--r--usr/src/cmd/dfs.cmds/sharemgr/Makefile.com2
-rw-r--r--usr/src/cmd/diff/Makefile7
-rw-r--r--usr/src/cmd/diff3/Makefile4
-rw-r--r--usr/src/cmd/dis/Makefile2
-rw-r--r--usr/src/cmd/dispadmin/Makefile1
-rw-r--r--usr/src/cmd/dladm/Makefile4
-rw-r--r--usr/src/cmd/dlmgmtd/Makefile3
-rw-r--r--usr/src/cmd/dlstat/Makefile5
-rw-r--r--usr/src/cmd/drd/Makefile4
-rw-r--r--usr/src/cmd/dtrace/test/cmd/baddof/Makefile3
-rw-r--r--usr/src/cmd/dtrace/test/cmd/badioctl/Makefile4
-rw-r--r--usr/src/cmd/dtrace/test/tst/Makefile.com6
-rw-r--r--usr/src/cmd/du/Makefile4
-rw-r--r--usr/src/cmd/ed/Makefile6
-rw-r--r--usr/src/cmd/eeprom/Makefile.com4
-rw-r--r--usr/src/cmd/egrep/Makefile6
-rw-r--r--usr/src/cmd/eqn/eqn.d/Makefile8
-rw-r--r--usr/src/cmd/eqn/neqn.d/Makefile10
-rw-r--r--usr/src/cmd/expr/Makefile2
-rw-r--r--usr/src/cmd/exstr/Makefile4
-rw-r--r--usr/src/cmd/factor/Makefile3
-rw-r--r--usr/src/cmd/fcinfo/Makefile2
-rw-r--r--usr/src/cmd/fdformat/Makefile2
-rw-r--r--usr/src/cmd/fgrep/Makefile4
-rw-r--r--usr/src/cmd/file/Makefile5
-rw-r--r--usr/src/cmd/file/elf_read.c32
-rw-r--r--usr/src/cmd/filebench/Makefile.com7
-rw-r--r--usr/src/cmd/filesync/Makefile3
-rw-r--r--usr/src/cmd/find/Makefile6
-rw-r--r--usr/src/cmd/flowstat/Makefile3
-rw-r--r--usr/src/cmd/fm/eversholt/Makefile.esc.com11
-rw-r--r--usr/src/cmd/fm/fmd/Makefile.fmd5
-rw-r--r--usr/src/cmd/fm/fmdump/Makefile.com2
-rw-r--r--usr/src/cmd/fm/fminject/Makefile.com6
-rw-r--r--usr/src/cmd/fm/ipmitopo/Makefile.com2
-rw-r--r--usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile2
-rw-r--r--usr/src/cmd/fm/modules/common/disk-monitor/Makefile2
-rw-r--r--usr/src/cmd/fm/modules/common/eversholt/Makefile6
-rw-r--r--usr/src/cmd/fm/modules/common/fabric-xlate/Makefile4
-rw-r--r--usr/src/cmd/fm/modules/common/io-retire/Makefile2
-rw-r--r--usr/src/cmd/fm/modules/common/ip-transport/Makefile2
-rw-r--r--usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile2
-rw-r--r--usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile5
-rw-r--r--usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile4
-rw-r--r--usr/src/cmd/fm/modules/sun4v/etm/Makefile4
-rw-r--r--usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile2
-rw-r--r--usr/src/cmd/fm/notify/smtp-notify/Makefile.com2
-rw-r--r--usr/src/cmd/fm/notify/snmp-notify/Makefile.com2
-rw-r--r--usr/src/cmd/fm/schemes/cpu/amd64/Makefile3
-rw-r--r--usr/src/cmd/fm/schemes/cpu/i386/Makefile4
-rw-r--r--usr/src/cmd/fm/schemes/cpu/sparc/Makefile4
-rw-r--r--usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile4
-rw-r--r--usr/src/cmd/fmt/Makefile5
-rw-r--r--usr/src/cmd/fmtmsg/Makefile7
-rw-r--r--usr/src/cmd/format/Makefile5
-rw-r--r--usr/src/cmd/fruadm/Makefile1
-rw-r--r--usr/src/cmd/fs.d/Makefile7
-rw-r--r--usr/src/cmd/fs.d/autofs/Makefile8
-rw-r--r--usr/src/cmd/fs.d/cachefs/Makefile.cachefs9
-rw-r--r--usr/src/cmd/fs.d/dev/Makefile4
-rw-r--r--usr/src/cmd/fs.d/hsfs/fstyp/Makefile4
-rw-r--r--usr/src/cmd/fs.d/hsfs/labelit/Makefile6
-rw-r--r--usr/src/cmd/fs.d/hsfs/mount/Makefile4
-rw-r--r--usr/src/cmd/fs.d/nfs/dfmounts/Makefile5
-rw-r--r--usr/src/cmd/fs.d/nfs/dfshares/Makefile5
-rw-r--r--usr/src/cmd/fs.d/nfs/mount/Makefile7
-rw-r--r--usr/src/cmd/fs.d/nfs/mountd/Makefile9
-rw-r--r--usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile7
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsd/Makefile5
-rw-r--r--usr/src/cmd/fs.d/nfs/nfslog/Makefile7
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsmapid/Makefile4
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsref/Makefile2
-rw-r--r--usr/src/cmd/fs.d/nfs/nfsstat/Makefile1
-rw-r--r--usr/src/cmd/fs.d/nfs/rquotad/Makefile4
-rw-r--r--usr/src/cmd/fs.d/nfs/showmount/Makefile8
-rw-r--r--usr/src/cmd/fs.d/nfs/statd/Makefile8
-rw-r--r--usr/src/cmd/fs.d/pcfs/fsck/Makefile7
-rw-r--r--usr/src/cmd/fs.d/pcfs/mkfs/Makefile3
-rw-r--r--usr/src/cmd/fs.d/pcfs/mount/Makefile4
-rw-r--r--usr/src/cmd/fs.d/reparsed/Makefile1
-rw-r--r--usr/src/cmd/fs.d/smbclnt/chacl/Makefile2
-rw-r--r--usr/src/cmd/fs.d/smbclnt/lsacl/Makefile1
-rw-r--r--usr/src/cmd/fs.d/smbclnt/mount/Makefile2
-rw-r--r--usr/src/cmd/fs.d/smbclnt/test/Makefile1
-rw-r--r--usr/src/cmd/fs.d/tmpfs/Makefile4
-rw-r--r--usr/src/cmd/fs.d/udfs/fsck/Makefile5
-rw-r--r--usr/src/cmd/fs.d/udfs/fsdb/Makefile9
-rw-r--r--usr/src/cmd/fs.d/udfs/fstyp/Makefile5
-rw-r--r--usr/src/cmd/fs.d/udfs/labelit/Makefile5
-rw-r--r--usr/src/cmd/fs.d/udfs/mkfs/Makefile5
-rw-r--r--usr/src/cmd/fs.d/ufs/df/Makefile7
-rw-r--r--usr/src/cmd/fs.d/ufs/edquota/Makefile4
-rw-r--r--usr/src/cmd/fs.d/ufs/ff/Makefile4
-rw-r--r--usr/src/cmd/fs.d/ufs/fsck/Makefile7
-rw-r--r--usr/src/cmd/fs.d/ufs/fsdb/Makefile9
-rw-r--r--usr/src/cmd/fs.d/ufs/fssnap/Makefile6
-rw-r--r--usr/src/cmd/fs.d/ufs/mkfs/Makefile7
-rw-r--r--usr/src/cmd/fs.d/ufs/mount/Makefile4
-rw-r--r--usr/src/cmd/fs.d/ufs/newfs/Makefile6
-rw-r--r--usr/src/cmd/fs.d/ufs/quota/Makefile4
-rw-r--r--usr/src/cmd/fs.d/ufs/quotacheck/Makefile6
-rw-r--r--usr/src/cmd/fs.d/ufs/quotaon/Makefile3
-rw-r--r--usr/src/cmd/fs.d/ufs/repquota/Makefile7
-rw-r--r--usr/src/cmd/fs.d/ufs/roll_log/Makefile5
-rw-r--r--usr/src/cmd/fs.d/ufs/tunefs/Makefile5
-rw-r--r--usr/src/cmd/fs.d/ufs/volcopy/Makefile15
-rw-r--r--usr/src/cmd/fuser/Makefile4
-rw-r--r--usr/src/cmd/fwflash/Makefile.com4
-rw-r--r--usr/src/cmd/gencat/Makefile5
-rw-r--r--usr/src/cmd/geniconvtbl/Makefile.com8
-rw-r--r--usr/src/cmd/genmsg/Makefile7
-rw-r--r--usr/src/cmd/getconf/Makefile2
-rw-r--r--usr/src/cmd/getent/Makefile5
-rw-r--r--usr/src/cmd/getfacl/Makefile5
-rw-r--r--usr/src/cmd/grep/grep.c105
-rw-r--r--usr/src/cmd/grep_xpg4/Makefile5
-rw-r--r--usr/src/cmd/grep_xpg4/grep.c197
-rw-r--r--usr/src/cmd/groups/Makefile4
-rw-r--r--usr/src/cmd/grpck/Makefile6
-rw-r--r--usr/src/cmd/gss/gssd/Makefile5
-rw-r--r--usr/src/cmd/hal/Makefile.hal7
-rw-r--r--usr/src/cmd/halt/Makefile2
-rw-r--r--usr/src/cmd/hotplugd/Makefile2
-rw-r--r--usr/src/cmd/id/Makefile5
-rw-r--r--usr/src/cmd/idmap/idmap/Makefile8
-rw-r--r--usr/src/cmd/idmap/idmapd/Makefile6
-rw-r--r--usr/src/cmd/init/Makefile2
-rw-r--r--usr/src/cmd/intrstat/Makefile.com1
-rw-r--r--usr/src/cmd/ipf/Makefile.ipf7
-rw-r--r--usr/src/cmd/isainfo/Makefile3
-rw-r--r--usr/src/cmd/iscsiadm/Makefile6
-rw-r--r--usr/src/cmd/isns/isnsadm/Makefile3
-rw-r--r--usr/src/cmd/isns/isnsd/Makefile5
-rw-r--r--usr/src/cmd/kbd/Makefile1
-rw-r--r--usr/src/cmd/keyserv/Makefile7
-rw-r--r--usr/src/cmd/krb5/kadmin/cli/Makefile8
-rw-r--r--usr/src/cmd/krb5/kadmin/dbutil/Makefile7
-rw-r--r--usr/src/cmd/krb5/kadmin/gui/native/Makefile.com6
-rw-r--r--usr/src/cmd/krb5/kadmin/kclient/Makefile4
-rw-r--r--usr/src/cmd/krb5/kadmin/kdcmgr/Makefile7
-rw-r--r--usr/src/cmd/krb5/kadmin/kpasswd/Makefile6
-rw-r--r--usr/src/cmd/krb5/kadmin/ktutil/Makefile5
-rw-r--r--usr/src/cmd/krb5/kadmin/server/Makefile5
-rw-r--r--usr/src/cmd/krb5/kdestroy/Makefile5
-rw-r--r--usr/src/cmd/krb5/kinit/Makefile6
-rw-r--r--usr/src/cmd/krb5/klist/Makefile1
-rw-r--r--usr/src/cmd/krb5/kproplog/Makefile6
-rw-r--r--usr/src/cmd/krb5/krb5kdc/Makefile8
-rw-r--r--usr/src/cmd/krb5/kwarn/Makefile7
-rw-r--r--usr/src/cmd/krb5/ldap_util/Makefile7
-rw-r--r--usr/src/cmd/krb5/slave/Makefile10
-rw-r--r--usr/src/cmd/ksh/Makefile.com1
-rw-r--r--usr/src/cmd/ksh/builtins/Makefile2
-rw-r--r--usr/src/cmd/latencytop/Makefile.com3
-rw-r--r--usr/src/cmd/ldap/Makefile.com6
-rw-r--r--usr/src/cmd/ldapcachemgr/Makefile4
-rw-r--r--usr/src/cmd/ldmad/Makefile1
-rw-r--r--usr/src/cmd/link/Makefile4
-rw-r--r--usr/src/cmd/listen/Makefile6
-rw-r--r--usr/src/cmd/loadkeys/Makefile9
-rw-r--r--usr/src/cmd/localedef/Makefile4
-rw-r--r--usr/src/cmd/localedef/ctype.c19
-rw-r--r--usr/src/cmd/lockstat/Makefile.com1
-rw-r--r--usr/src/cmd/lofiadm/Makefile3
-rw-r--r--usr/src/cmd/logadm/Makefile3
-rw-r--r--usr/src/cmd/logins/Makefile7
-rw-r--r--usr/src/cmd/look/Makefile4
-rw-r--r--usr/src/cmd/ls/Makefile.com2
-rw-r--r--usr/src/cmd/luxadm/Makefile7
-rw-r--r--usr/src/cmd/lvm/Makefile.lvm9
-rw-r--r--usr/src/cmd/lvm/metassist/Makefile.env6
-rw-r--r--usr/src/cmd/mail/Makefile6
-rw-r--r--usr/src/cmd/mailx/Makefile4
-rw-r--r--usr/src/cmd/man/src/Makefile4
-rw-r--r--usr/src/cmd/mdb/Makefile.kmdb7
-rw-r--r--usr/src/cmd/mdb/Makefile.libstand4
-rw-r--r--usr/src/cmd/mdb/Makefile.libstandctf3
-rw-r--r--usr/src/cmd/mdb/Makefile.mdb7
-rw-r--r--usr/src/cmd/mdb/Makefile.mdb_ks3
-rw-r--r--usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c12
-rw-r--r--usr/src/cmd/mdb/common/kmdb/mapfile_skel5
-rw-r--r--usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c11
-rw-r--r--usr/src/cmd/mdb/common/modules/zfs/zfs.c3
-rw-r--r--usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile6
-rw-r--r--usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile6
-rw-r--r--usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile6
-rw-r--r--usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile6
-rw-r--r--usr/src/cmd/mdb/intel/Makefile.libstand6
-rw-r--r--usr/src/cmd/mdb/intel/amd64/Makefile.kmdb13
-rw-r--r--usr/src/cmd/mdb/intel/amd64/fcip/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/amd64/fctl/Makefile6
-rw-r--r--usr/src/cmd/mdb/intel/amd64/genunix/Makefile7
-rw-r--r--usr/src/cmd/mdb/intel/amd64/idm/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/ipc/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/ipp/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/libproc/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/libtopo/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/amd64/libumem/Makefile4
-rw-r--r--usr/src/cmd/mdb/intel/amd64/libzpool/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/mdb/Makefile12
-rw-r--r--usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/amd64/pmcs/Makefile4
-rw-r--r--usr/src/cmd/mdb/intel/amd64/qlc/Makefile1
-rw-r--r--usr/src/cmd/mdb/intel/amd64/rdc/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/amd64/ufs/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/amd64/zfs/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/fcip/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/ia32/fctl/Makefile6
-rw-r--r--usr/src/cmd/mdb/intel/ia32/genunix/Makefile9
-rw-r--r--usr/src/cmd/mdb/intel/ia32/idm/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/ia32/ipc/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/ipp/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/libproc/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/libtopo/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/ia32/libumem/Makefile4
-rw-r--r--usr/src/cmd/mdb/intel/ia32/libzpool/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/ia32/pmcs/Makefile4
-rw-r--r--usr/src/cmd/mdb/intel/ia32/qlc/Makefile1
-rw-r--r--usr/src/cmd/mdb/intel/ia32/rdc/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/ia32/ufs/Makefile3
-rw-r--r--usr/src/cmd/mdb/intel/ia32/zfs/Makefile4
-rw-r--r--usr/src/cmd/mdb/intel/libstand/uname.c42
-rw-r--r--usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c250
-rw-r--r--usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile2
-rw-r--r--usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libproc/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libtopo/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libumem/Makefile4
-rw-r--r--usr/src/cmd/mdb/sparc/v7/libzpool/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/fcip/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v9/fctl/Makefile4
-rw-r--r--usr/src/cmd/mdb/sparc/v9/genunix/Makefile7
-rw-r--r--usr/src/cmd/mdb/sparc/v9/idm/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v9/ipc/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/ipp/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libproc/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libtopo/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libumem/Makefile4
-rw-r--r--usr/src/cmd/mdb/sparc/v9/libzpool/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v9/pmcs/Makefile4
-rw-r--r--usr/src/cmd/mdb/sparc/v9/qlc/Makefile1
-rw-r--r--usr/src/cmd/mdb/sparc/v9/rdc/Makefile2
-rw-r--r--usr/src/cmd/mdb/sparc/v9/ufs/Makefile3
-rw-r--r--usr/src/cmd/mdb/sparc/v9/zfs/Makefile3
-rw-r--r--usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile2
-rw-r--r--usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile2
-rw-r--r--usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile1
-rw-r--r--usr/src/cmd/mdb/tools/findfp/Makefile.com3
-rw-r--r--usr/src/cmd/mdb/tools/setdynflag/Makefile.com3
-rw-r--r--usr/src/cmd/mkdir/Makefile6
-rw-r--r--usr/src/cmd/mkfifo/Makefile5
-rw-r--r--usr/src/cmd/mkmsgs/Makefile2
-rw-r--r--usr/src/cmd/mknod/Makefile3
-rw-r--r--usr/src/cmd/mkpwdict/Makefile4
-rw-r--r--usr/src/cmd/mktemp/Makefile4
-rw-r--r--usr/src/cmd/modload/Makefile.com2
-rw-r--r--usr/src/cmd/more/Makefile5
-rw-r--r--usr/src/cmd/msgfmt/Makefile7
-rw-r--r--usr/src/cmd/mv/Makefile5
-rw-r--r--usr/src/cmd/ndmpadm/Makefile2
-rw-r--r--usr/src/cmd/ndmpd/Makefile5
-rw-r--r--usr/src/cmd/newform/Makefile4
-rw-r--r--usr/src/cmd/news/Makefile3
-rw-r--r--usr/src/cmd/newtask/Makefile.com3
-rw-r--r--usr/src/cmd/nl/Makefile6
-rw-r--r--usr/src/cmd/nlsadmin/Makefile3
-rw-r--r--usr/src/cmd/nscd/Makefile5
-rw-r--r--usr/src/cmd/oamuser/group/Makefile1
-rw-r--r--usr/src/cmd/oamuser/lib/Makefile3
-rw-r--r--usr/src/cmd/oamuser/user/Makefile4
-rw-r--r--usr/src/cmd/oawk/Makefile10
-rw-r--r--usr/src/cmd/oplhpd/Makefile2
-rw-r--r--usr/src/cmd/pack/Makefile4
-rw-r--r--usr/src/cmd/parted/Makefile1
-rw-r--r--usr/src/cmd/passmgmt/Makefile3
-rw-r--r--usr/src/cmd/passwd/Makefile4
-rw-r--r--usr/src/cmd/pbind/Makefile.com2
-rw-r--r--[-rwxr-xr-x]usr/src/cmd/pcidr/Makefile.com4
-rw-r--r--usr/src/cmd/pcitool/Makefile.com3
-rw-r--r--usr/src/cmd/pg/Makefile6
-rw-r--r--usr/src/cmd/pgrep/Makefile1
-rw-r--r--usr/src/cmd/picl/plugins/Makefile.com6
-rw-r--r--usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com3
-rw-r--r--usr/src/cmd/plimit/amd64/Makefile3
-rw-r--r--usr/src/cmd/plimit/i386/Makefile5
-rw-r--r--usr/src/cmd/plimit/sparcv9/Makefile1
-rw-r--r--usr/src/cmd/policykit/Makefile4
-rw-r--r--usr/src/cmd/pools/Makefile.pools8
-rw-r--r--usr/src/cmd/power/Makefile3
-rw-r--r--usr/src/cmd/power/powerd.c1
-rw-r--r--usr/src/cmd/powertop/Makefile.com2
-rw-r--r--usr/src/cmd/pr/Makefile4
-rw-r--r--usr/src/cmd/praudit/Makefile3
-rw-r--r--usr/src/cmd/prctl/Makefile.com6
-rw-r--r--usr/src/cmd/priocntl/Makefile2
-rw-r--r--usr/src/cmd/projects/Makefile3
-rw-r--r--usr/src/cmd/prstat/Makefile.com1
-rw-r--r--usr/src/cmd/prtconf/Makefile.com5
-rw-r--r--usr/src/cmd/prtdiag/Makefile.com2
-rw-r--r--usr/src/cmd/prtfru/Makefile2
-rw-r--r--usr/src/cmd/prtvtoc/Makefile3
-rw-r--r--usr/src/cmd/ps/Makefile.com2
-rw-r--r--usr/src/cmd/psrinfo/Makefile1
-rw-r--r--usr/src/cmd/psrset/Makefile.com2
-rw-r--r--usr/src/cmd/ptools/Makefile.bld15
-rw-r--r--usr/src/cmd/ptools/pfiles/pfiles.c266
-rw-r--r--usr/src/cmd/raidctl/Makefile1
-rw-r--r--usr/src/cmd/ramdiskadm/Makefile3
-rw-r--r--usr/src/cmd/rcap/Makefile.com5
-rw-r--r--usr/src/cmd/rcm_daemon/Makefile.com5
-rw-r--r--usr/src/cmd/rctladm/Makefile2
-rw-r--r--usr/src/cmd/refer/Makefile9
-rw-r--r--usr/src/cmd/regcmp/Makefile4
-rw-r--r--usr/src/cmd/rexd/Makefile9
-rw-r--r--usr/src/cmd/rm/Makefile3
-rw-r--r--usr/src/cmd/rmdir/Makefile3
-rw-r--r--usr/src/cmd/rmformat/Makefile4
-rw-r--r--usr/src/cmd/rmmount/Makefile8
-rw-r--r--usr/src/cmd/rmvolmgr/Makefile8
-rw-r--r--usr/src/cmd/rpcbind/Makefile8
-rw-r--r--usr/src/cmd/rpcgen/Makefile7
-rw-r--r--usr/src/cmd/rpcinfo/Makefile4
-rw-r--r--usr/src/cmd/rpcsvc/Makefile7
-rw-r--r--usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile4
-rw-r--r--usr/src/cmd/sa/Makefile3
-rw-r--r--usr/src/cmd/saf/Makefile5
-rw-r--r--usr/src/cmd/sasinfo/Makefile2
-rw-r--r--usr/src/cmd/savecore/Makefile.com1
-rw-r--r--usr/src/cmd/scadm/Makefile.com3
-rw-r--r--usr/src/cmd/script/Makefile2
-rw-r--r--usr/src/cmd/scsi/sestopo/Makefile.com2
-rw-r--r--usr/src/cmd/scsi/smp/Makefile.com2
-rw-r--r--usr/src/cmd/sdiff/Makefile4
-rw-r--r--usr/src/cmd/sendmail/Makefile.cmd6
-rw-r--r--usr/src/cmd/sendmail/libmilter/Makefile.com4
-rw-r--r--usr/src/cmd/setfacl/Makefile6
-rw-r--r--usr/src/cmd/setuname/Makefile.com4
-rw-r--r--usr/src/cmd/sf880drd/Makefile5
-rw-r--r--usr/src/cmd/sgs/Makefile.com4
-rw-r--r--usr/src/cmd/sgs/ar/Makefile.com1
-rw-r--r--usr/src/cmd/sgs/dump/Makefile.com4
-rw-r--r--usr/src/cmd/sgs/elfdump/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/elfdump/common/_elfdump.h2
-rw-r--r--usr/src/cmd/sgs/elfdump/common/corenote.c51
-rw-r--r--usr/src/cmd/sgs/elfdump/common/dwarf.c21
-rw-r--r--usr/src/cmd/sgs/elfdump/common/elfdump.c28
-rw-r--r--usr/src/cmd/sgs/elfdump/common/elfdump.msg13
-rw-r--r--usr/src/cmd/sgs/elfdump/common/struct_layout.h28
-rw-r--r--usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c22
-rw-r--r--usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c22
-rw-r--r--usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c23
-rw-r--r--usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c22
-rw-r--r--usr/src/cmd/sgs/elfedit/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/elfedit/modules/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/elfwrap/Makefile.com2
-rw-r--r--usr/src/cmd/sgs/error/i386/Makefile6
-rw-r--r--usr/src/cmd/sgs/error/sparc/Makefile4
-rw-r--r--usr/src/cmd/sgs/gprof/Makefile.com1
-rw-r--r--usr/src/cmd/sgs/include/conv.h5
-rw-r--r--usr/src/cmd/sgs/include/dwarf.h5
-rw-r--r--usr/src/cmd/sgs/ld/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/lex/Makefile.com7
-rw-r--r--usr/src/cmd/sgs/libconv/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/libconv/common/bld_vernote.ksh11
-rw-r--r--usr/src/cmd/sgs/libconv/common/corenote.c142
-rw-r--r--usr/src/cmd/sgs/libconv/common/corenote.msg45
-rw-r--r--usr/src/cmd/sgs/libelf/Makefile.com3
-rw-r--r--usr/src/cmd/sgs/libld/Makefile.com8
-rw-r--r--usr/src/cmd/sgs/libld/common/files.c3
-rw-r--r--usr/src/cmd/sgs/libld/common/unwind.c13
-rw-r--r--usr/src/cmd/sgs/liblddbg/Makefile.com6
-rw-r--r--usr/src/cmd/sgs/librtld/Makefile.com5
-rw-r--r--usr/src/cmd/sgs/librtld_db/Makefile.com2
-rw-r--r--usr/src/cmd/sgs/m4/i386/Makefile8
-rw-r--r--usr/src/cmd/sgs/m4/sparc/Makefile5
-rw-r--r--usr/src/cmd/sgs/mcs/Makefile.com2
-rw-r--r--usr/src/cmd/sgs/nm/amd64/Makefile3
-rw-r--r--usr/src/cmd/sgs/nm/i386/Makefile3
-rw-r--r--usr/src/cmd/sgs/nm/sparc/Makefile1
-rw-r--r--usr/src/cmd/sgs/nm/sparcv9/Makefile1
-rw-r--r--usr/src/cmd/sgs/packages/common/SUNWonld-README9
-rw-r--r--usr/src/cmd/sgs/prof/Makefile.com1
-rw-r--r--usr/src/cmd/sgs/rtld/Makefile.com4
-rw-r--r--usr/src/cmd/sgs/rtld/common/cap.c32
-rw-r--r--usr/src/cmd/sgs/rtld/common/rtld.msg1
-rw-r--r--usr/src/cmd/sgs/rtld/common/setup.c9
-rw-r--r--usr/src/cmd/sgs/rtld/mdbmod/Makefile.com2
-rw-r--r--usr/src/cmd/sgs/size/Makefile.com4
-rw-r--r--usr/src/cmd/sgs/test/README19
-rw-r--r--usr/src/cmd/sgs/test/ld/assert-deflib/link.c23
-rw-r--r--usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh135
-rw-r--r--usr/src/cmd/sgs/tools/common/leb128.c32
-rw-r--r--usr/src/cmd/sgs/tsort/i386/Makefile7
-rw-r--r--usr/src/cmd/sgs/tsort/sparc/Makefile4
-rw-r--r--usr/src/cmd/sgs/unifdef/i386/Makefile7
-rw-r--r--usr/src/cmd/sgs/unifdef/sparc/Makefile6
-rw-r--r--usr/src/cmd/sgs/yacc/Makefile.com4
-rw-r--r--usr/src/cmd/sh/Makefile4
-rw-r--r--usr/src/cmd/shcomp/Makefile2
-rw-r--r--usr/src/cmd/smbsrv/smbadm/Makefile4
-rw-r--r--usr/src/cmd/smserverd/Makefile4
-rw-r--r--usr/src/cmd/soelim/Makefile7
-rw-r--r--usr/src/cmd/sort/Makefile.com8
-rw-r--r--usr/src/cmd/spell/Makefile5
-rw-r--r--usr/src/cmd/sqlite/Makefile4
-rw-r--r--usr/src/cmd/srchtxt/Makefile3
-rw-r--r--usr/src/cmd/ssh/Makefile.ssh-common5
-rw-r--r--usr/src/cmd/stat/fsstat/Makefile1
-rw-r--r--usr/src/cmd/stat/iostat/Makefile3
-rw-r--r--usr/src/cmd/stat/mpstat/Makefile3
-rw-r--r--usr/src/cmd/stat/vmstat/Makefile3
-rw-r--r--usr/src/cmd/stmfadm/Makefile3
-rw-r--r--usr/src/cmd/stmsboot/Makefile1
-rw-r--r--usr/src/cmd/streams/log/Makefile1
-rw-r--r--usr/src/cmd/streams/strcmd/Makefile2
-rw-r--r--usr/src/cmd/strings/Makefile.com4
-rw-r--r--usr/src/cmd/su/Makefile2
-rw-r--r--usr/src/cmd/sunpc/other/Makefile6
-rw-r--r--usr/src/cmd/svc/configd/Makefile8
-rw-r--r--usr/src/cmd/svc/lsvcrun/Makefile3
-rw-r--r--usr/src/cmd/svc/mfstscan/Makefile3
-rw-r--r--usr/src/cmd/svc/startd/Makefile7
-rw-r--r--usr/src/cmd/svc/svcadm/Makefile3
-rw-r--r--usr/src/cmd/svc/svccfg/Makefile7
-rw-r--r--usr/src/cmd/svc/svcprop/Makefile2
-rw-r--r--usr/src/cmd/svc/svcs/Makefile3
-rw-r--r--usr/src/cmd/svr4pkg/Makefile.svr4pkg8
-rw-r--r--usr/src/cmd/svr4pkg/libinst/Makefile6
-rw-r--r--usr/src/cmd/swap/Makefile.com1
-rw-r--r--usr/src/cmd/sysdef/Makefile.com1
-rw-r--r--usr/src/cmd/syseventadm/Makefile1
-rw-r--r--usr/src/cmd/syseventd/daemons/syseventd/Makefile4
-rw-r--r--usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile5
-rw-r--r--usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile6
-rw-r--r--usr/src/cmd/syseventd/modules/zfs_mod/Makefile2
-rw-r--r--usr/src/cmd/syslogd/Makefile.com2
-rw-r--r--usr/src/cmd/tabs/Makefile4
-rw-r--r--usr/src/cmd/tar/Makefile3
-rw-r--r--usr/src/cmd/tbl/Makefile9
-rw-r--r--usr/src/cmd/tcopy/Makefile8
-rw-r--r--usr/src/cmd/tcpd/Makefile14
-rw-r--r--usr/src/cmd/th_tools/Makefile2
-rw-r--r--usr/src/cmd/tic/Makefile7
-rw-r--r--usr/src/cmd/tip/Makefile3
-rw-r--r--usr/src/cmd/tip/aculib/Makefile5
-rw-r--r--usr/src/cmd/tnf/prex/Makefile.com11
-rw-r--r--usr/src/cmd/tnf/tnfxtract/Makefile.com3
-rw-r--r--usr/src/cmd/tput/Makefile3
-rw-r--r--usr/src/cmd/tput/tput.c7
-rw-r--r--usr/src/cmd/trapstat/sun4/Makefile3
-rw-r--r--usr/src/cmd/troff/nroff.d/Makefile10
-rw-r--r--usr/src/cmd/troff/troff.d/Makefile9
-rw-r--r--usr/src/cmd/truss/Makefile.com3
-rw-r--r--usr/src/cmd/tsol/tnctl/Makefile3
-rw-r--r--usr/src/cmd/tsol/tnd/Makefile3
-rw-r--r--usr/src/cmd/tsol/updatehome/Makefile5
-rw-r--r--usr/src/cmd/ttymon/Makefile5
-rw-r--r--usr/src/cmd/ucodeadm/Makefile4
-rw-r--r--usr/src/cmd/uname/Makefile1
-rw-r--r--usr/src/cmd/units/Makefile5
-rw-r--r--usr/src/cmd/unlink/Makefile2
-rw-r--r--usr/src/cmd/unpack/Makefile4
-rw-r--r--usr/src/cmd/users/Makefile6
-rw-r--r--usr/src/cmd/utmpd/Makefile2
-rw-r--r--usr/src/cmd/vgrind/Makefile5
-rw-r--r--usr/src/cmd/vi/misc/Makefile9
-rw-r--r--usr/src/cmd/vi/port/Makefile10
-rw-r--r--usr/src/cmd/volcheck/Makefile8
-rw-r--r--usr/src/cmd/volrmmount/Makefile8
-rw-r--r--usr/src/cmd/vrrpadm/Makefile2
-rw-r--r--[-rwxr-xr-x]usr/src/cmd/vscan/vscand/Makefile4
-rw-r--r--usr/src/cmd/vt/Makefile1
-rw-r--r--usr/src/cmd/w/amd64/Makefile1
-rw-r--r--usr/src/cmd/w/i386/Makefile1
-rw-r--r--usr/src/cmd/w/sparcv9/Makefile1
-rw-r--r--usr/src/cmd/wall/Makefile2
-rw-r--r--usr/src/cmd/whodo/amd64/Makefile1
-rw-r--r--usr/src/cmd/whodo/i386/Makefile1
-rw-r--r--usr/src/cmd/whodo/sparcv9/Makefile1
-rw-r--r--usr/src/cmd/write/Makefile1
-rw-r--r--usr/src/cmd/xargs/Makefile4
-rw-r--r--usr/src/cmd/xstr/Makefile5
-rw-r--r--usr/src/cmd/ypcmd/Makefile10
-rw-r--r--usr/src/cmd/ypcmd/mknetid/Makefile5
-rw-r--r--usr/src/cmd/ypcmd/revnetgroup/Makefile6
-rw-r--r--usr/src/cmd/ypcmd/yppasswd/Makefile4
-rw-r--r--usr/src/cmd/ypcmd/ypupdated/Makefile3
-rw-r--r--usr/src/cmd/zdb/Makefile.com2
-rw-r--r--usr/src/cmd/zdb/zdb.c106
-rw-r--r--usr/src/cmd/zfs/Makefile6
-rw-r--r--usr/src/cmd/zfs/zfs_main.c2
-rw-r--r--usr/src/cmd/zic/Makefile3
-rw-r--r--usr/src/cmd/zinject/Makefile.com5
-rw-r--r--usr/src/cmd/zinject/translate.c15
-rw-r--r--usr/src/cmd/zinject/zinject.c32
-rw-r--r--usr/src/cmd/zlogin/Makefile2
-rw-r--r--usr/src/cmd/zlook/Makefile.com2
-rw-r--r--usr/src/cmd/zoneadm/Makefile2
-rw-r--r--usr/src/cmd/zoneadmd/Makefile8
-rw-r--r--usr/src/cmd/zonecfg/Makefile5
-rw-r--r--usr/src/cmd/zonestat/zonestat/Makefile6
-rw-r--r--usr/src/cmd/zonestat/zonestatd/Makefile8
-rw-r--r--usr/src/cmd/zpool/Makefile4
-rw-r--r--usr/src/cmd/zpool/zpool_main.c29
-rw-r--r--usr/src/cmd/zstreamdump/Makefile2
-rw-r--r--usr/src/cmd/ztest/Makefile.com2
-rw-r--r--usr/src/cmd/ztest/ztest.c99
648 files changed, 3221 insertions, 1300 deletions
diff --git a/usr/src/cmd/abi/appcert/static_prof/Makefile.com b/usr/src/cmd/abi/appcert/static_prof/Makefile.com
index 3d9f48b25c..98d2d4f524 100644
--- a/usr/src/cmd/abi/appcert/static_prof/Makefile.com
+++ b/usr/src/cmd/abi/appcert/static_prof/Makefile.com
@@ -23,8 +23,6 @@
# Copyright (c) 1997-2000 by Sun Microsystems, Inc.
# All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# cmd/abi/appcert/static_prof/Makefile.com
#
@@ -35,6 +33,8 @@ SRCS = $(PROG:%=../%.c)
# CPPFLAGS = -I..
CFLAGS += $(LDLIBS)
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS = -lelf
LINTFLAGS = -nmxsuF -errtags=yes
diff --git a/usr/src/cmd/abi/spectrans/parser/Makefile.targ b/usr/src/cmd/abi/spectrans/parser/Makefile.targ
index c00da5548c..59837ab138 100644
--- a/usr/src/cmd/abi/spectrans/parser/Makefile.targ
+++ b/usr/src/cmd/abi/spectrans/parser/Makefile.targ
@@ -23,10 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/abi/spectrans/util/Makefile.targ
-#
.KEEP_STATE:
@@ -45,6 +41,10 @@ LINTFLAGS += -xsuF -errtags=yes
CLEANFILES += $(LINTOUT)
CLOBBERFILES += $(LINTLIB)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
objs/%.o: ../%.c
$(COMPILE.c) -o $@ $<
$(POST_PROCESS_O)
diff --git a/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ b/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ
index eba87b10e7..fe7c3a7883 100644
--- a/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ
+++ b/usr/src/cmd/abi/spectrans/spec2map/Makefile.targ
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1997-1999 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/abi/spectrans/spec2map/Makefile.targ
.KEEP_STATE:
@@ -37,3 +34,5 @@ OBJECTS = xlator.o \
util.o
include ../../Makefile.cmd
+
+CERRWARN += -_gcc=-Wno-switch
diff --git a/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ b/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ
index 18d83707af..2ff10bcdaa 100644
--- a/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ
+++ b/usr/src/cmd/abi/spectrans/spec2trace/Makefile.targ
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1997-1999 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/abi/spectrans/spec2trace/Makefile.targ
.KEEP_STATE:
@@ -45,6 +42,11 @@ OBJECTS = trace.o \
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+
parseproto := RM = @echo keeping # do not remove generated C code
parseproto := COPTFLAG = -g -DDEBUG -DMEM_DEBUG -DTRACE
parseproto: parseproto.o
diff --git a/usr/src/cmd/acct/Makefile b/usr/src/cmd/acct/Makefile
index 5ff39fa0d6..6db56fbdcf 100644
--- a/usr/src/cmd/acct/Makefile
+++ b/usr/src/cmd/acct/Makefile
@@ -88,6 +88,11 @@ $(LIBACCTD)/accton := FILEMODE= 04755
$(ETCINITPROG) := FILEMODE= 0744
$(ETCACCTPROG) := FILEMODE= 0644
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-address
+
.KEEP_STATE:
.PARALLEL: $(ALL)
diff --git a/usr/src/cmd/acct/lib/Makefile b/usr/src/cmd/acct/lib/Makefile
index 162b3c99d2..c7e94d6c0d 100644
--- a/usr/src/cmd/acct/lib/Makefile
+++ b/usr/src/cmd/acct/lib/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
#
@@ -34,6 +32,9 @@ SRCS= $(OBJS:%.o=%.c)
include ../../Makefile.cmd
CPPFLAGS = -D_LTYPES -I.. $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-extra
.KEEP_STATE:
diff --git a/usr/src/cmd/acctadm/Makefile b/usr/src/cmd/acctadm/Makefile
index be6466cd3f..6055a32f2b 100644
--- a/usr/src/cmd/acctadm/Makefile
+++ b/usr/src/cmd/acctadm/Makefile
@@ -35,6 +35,8 @@ include ../Makefile.cmd
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lexacct -lscf -lsecdb -ldladm
POFILE = acctadm.po
XGETFLAGS = -a -x acctadm.xcl
diff --git a/usr/src/cmd/addbadsec/Makefile b/usr/src/cmd/addbadsec/Makefile
index 5afbc88995..a4d48dbad2 100644
--- a/usr/src/cmd/addbadsec/Makefile
+++ b/usr/src/cmd/addbadsec/Makefile
@@ -32,6 +32,8 @@ include ../Makefile.cmd
CPPFLAGS += -D_EXTVTOC
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/allocate/Makefile b/usr/src/cmd/allocate/Makefile
index 789730c4b7..41339cdde6 100644
--- a/usr/src/cmd/allocate/Makefile
+++ b/usr/src/cmd/allocate/Makefile
@@ -27,6 +27,11 @@ ETCTSOLFILES = devalloc_defaults
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
+
ROOTSEC = $(ROOTETC)/security
ROOTSECDEV = $(ROOTSEC)/dev
ROOTSECLIB = $(ROOTSEC)/lib
diff --git a/usr/src/cmd/amt/Makefile.com b/usr/src/cmd/amt/Makefile.com
index d3519687af..a3a7691e4c 100644
--- a/usr/src/cmd/amt/Makefile.com
+++ b/usr/src/cmd/amt/Makefile.com
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/amt/Makefile.com
-#
PROG= amt
OBJS= amt.o
@@ -39,6 +35,8 @@ LDLIBS += -lelf
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
LINTFLAGS64 += -erroff=E_NAME_USED_NOT_DEF2
+CERRWARN += -_gcc=-Wno-uninitialized
+
CLEANFILES += $(PROG) $(OBJS)
.KEEP_STATE:
diff --git a/usr/src/cmd/ast/msgcc/Makefile b/usr/src/cmd/ast/msgcc/Makefile
index a5f1f24df5..1198c6184f 100644
--- a/usr/src/cmd/ast/msgcc/Makefile
+++ b/usr/src/cmd/ast/msgcc/Makefile
@@ -47,6 +47,10 @@ CPPFLAGS = \
CFLAGS += \
$(ASTCFLAGS)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-empty-body
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -last
msgcpp := LDLIBS += -lpp
diff --git a/usr/src/cmd/audio/audioctl/Makefile b/usr/src/cmd/audio/audioctl/Makefile
index 8d6a9212a7..f9c6b65c8b 100644
--- a/usr/src/cmd/audio/audioctl/Makefile
+++ b/usr/src/cmd/audio/audioctl/Makefile
@@ -30,6 +30,7 @@ include ../../Makefile.cmd
LDLIBS += -ldevinfo
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/audio/audioplay/Makefile b/usr/src/cmd/audio/audioplay/Makefile
index a60da712f1..f899ec0e32 100644
--- a/usr/src/cmd/audio/audioplay/Makefile
+++ b/usr/src/cmd/audio/audioplay/Makefile
@@ -23,9 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
-# Makefile for cmd/audio/audioplay
PROG= audioplay
@@ -40,6 +37,8 @@ LDLIBS += -laudio -lm
LDFLAGS += -L../utilities
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LINTFLAGS += -m -v -u $(LDFLAGS)
diff --git a/usr/src/cmd/audio/audiorecord/Makefile b/usr/src/cmd/audio/audiorecord/Makefile
index f1b2d8aaa5..910d48f955 100644
--- a/usr/src/cmd/audio/audiorecord/Makefile
+++ b/usr/src/cmd/audio/audiorecord/Makefile
@@ -23,9 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# Makefile for cmd/audio/audiorecord
PROG= audiorecord
@@ -40,6 +37,7 @@ LDLIBS += -laudio -lm
LDFLAGS += -L../utilities
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LINTFLAGS += -m -v -u $(LDFLAGS)
diff --git a/usr/src/cmd/audio/utilities/Makefile b/usr/src/cmd/audio/utilities/Makefile
index bc50c948af..40da0a01f5 100644
--- a/usr/src/cmd/audio/utilities/Makefile
+++ b/usr/src/cmd/audio/utilities/Makefile
@@ -33,6 +33,9 @@ INCLUDES += -I../include
CPPFLAGS += $(INCLUDES)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
LINTFLAGS += -m -v -u
diff --git a/usr/src/cmd/auditconfig/Makefile b/usr/src/cmd/auditconfig/Makefile
index fa563ae5b9..54d9e8e6b0 100644
--- a/usr/src/cmd/auditconfig/Makefile
+++ b/usr/src/cmd/auditconfig/Makefile
@@ -38,6 +38,8 @@ POFILE = $(PROG).po
MSGFILES = $(SRCS)
CPPFLAGS += -I$(LIBBSM)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/auditd/Makefile b/usr/src/cmd/auditd/Makefile
index 3a3df0394f..be82c21abc 100644
--- a/usr/src/cmd/auditd/Makefile
+++ b/usr/src/cmd/auditd/Makefile
@@ -37,6 +37,8 @@ AUDITD = $(SRC)/cmd/auditd
CPPFLAGS += -D_REENTRANT
CPPFLAGS += -I$(LIBBSM) -I$(AUDITD)
+CERRWARN += -_gcc=-Wno-parentheses
+
LDLIBS += -lbsm -lsecdb
OBJS = auditd.o doorway.o queue.o
diff --git a/usr/src/cmd/auditreduce/Makefile b/usr/src/cmd/auditreduce/Makefile
index 4808a0d28e..e84d51d229 100644
--- a/usr/src/cmd/auditreduce/Makefile
+++ b/usr/src/cmd/auditreduce/Makefile
@@ -41,6 +41,9 @@ MSGFILES = $(SRCS)
CPPFLAGS += -I$(TABLEDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LDLIBS += -lnsl -lbsm -lscf -ltsol
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/auditstat/Makefile b/usr/src/cmd/auditstat/Makefile
index 5f91b34739..99328ef576 100644
--- a/usr/src/cmd/auditstat/Makefile
+++ b/usr/src/cmd/auditstat/Makefile
@@ -41,6 +41,8 @@ POFILE = $(PROG).po
LDLIBS += -lbsm
CPPFLAGS += -I$(STATCOMMONDIR)
+CERRWARN += -_gcc=-Wno-extra
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/auths/Makefile b/usr/src/cmd/auths/Makefile
index 131eee0687..8e9d3c9c49 100644
--- a/usr/src/cmd/auths/Makefile
+++ b/usr/src/cmd/auths/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= auths
SRCS= $(PROG:%=%.c)
@@ -31,6 +29,8 @@ AUTHS= auths
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
ROOTBINAUTHS = $(AUTHS:%=$(ROOTBIN)/%)
.KEEP_STATE:
diff --git a/usr/src/cmd/autopush/Makefile b/usr/src/cmd/autopush/Makefile
index d5bc8d8051..4ff7a09068 100644
--- a/usr/src/cmd/autopush/Makefile
+++ b/usr/src/cmd/autopush/Makefile
@@ -23,14 +23,14 @@
# Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= autopush
ROOTFS_PROG= $(PROG)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(ROOTFS_PROG)
diff --git a/usr/src/cmd/avs/dsbitmap/Makefile b/usr/src/cmd/avs/dsbitmap/Makefile
index b00d148bf6..2b9380995e 100644
--- a/usr/src/cmd/avs/dsbitmap/Makefile
+++ b/usr/src/cmd/avs/dsbitmap/Makefile
@@ -35,7 +35,8 @@ OBJS= dsbitmap.o
SRCS= $(OBJS:%.o=%.c)
POFILE= $(OBJS:%.o=%.po)
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lunistat -ladm
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user
LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
diff --git a/usr/src/cmd/avs/dscfg/Makefile b/usr/src/cmd/avs/dscfg/Makefile
index 78f6879106..9b4a1eff03 100644
--- a/usr/src/cmd/avs/dscfg/Makefile
+++ b/usr/src/cmd/avs/dscfg/Makefile
@@ -38,7 +38,9 @@ SUBDIRS= etc
OBJS= dscfg.o
-CFLAGS += -v -D_SYSCALL32
+CFLAGS += $(CCVERBOSE) -D_SYSCALL32
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-address
LDLIBS += -ldscfg -lunistat
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_SYSCALL32
LINTFLAGS += -erroff=E_NOP_ELSE_STMT -erroff=E_FUNC_SET_NOT_USED
diff --git a/usr/src/cmd/avs/dscfglockd/Makefile b/usr/src/cmd/avs/dscfglockd/Makefile
index 08c1a0a171..3d7c3e008e 100644
--- a/usr/src/cmd/avs/dscfglockd/Makefile
+++ b/usr/src/cmd/avs/dscfglockd/Makefile
@@ -40,7 +40,8 @@ POFILES= $(OBJS:%.o=%.po)
dscfgcli := LDLIBS += -ldscfg -lnsl
dscfglockd := LDLIBS += -lunistat -ldscfg -lsocket -lnsl
-CFLAGS += -v -D_RDC_ -D_SYSCALL32
+CFLAGS += $(CCVERBOSE) -D_RDC_ -D_SYSCALL32
+CERRWARN += -_gcc=-Wno-switch
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_RDC_ -D_SYSCALL32
LINTFLAGS += -DDEBUG -erroff=E_SEC_SCANF_UNBOUNDED_COPY
LINTDIR = $(KBASE)/lintdir
diff --git a/usr/src/cmd/avs/dsstat/Makefile b/usr/src/cmd/avs/dsstat/Makefile
index f5da5be4d6..11ddd8c9a9 100644
--- a/usr/src/cmd/avs/dsstat/Makefile
+++ b/usr/src/cmd/avs/dsstat/Makefile
@@ -39,8 +39,12 @@ OBJS= dsstat.o ii_stats.o sndr_stats.o sdbc_stats.o \
multi_stats.o common.o report.o
SRCS= $(OBJS:%.o=%.c)
-CFLAGS += -v
-LDLIBS += -lkstat
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-clobbered
+LDLIBS += -L/usr/lib -lkstat
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user
LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
LINTDIR = $(KBASE)/lintdir
diff --git a/usr/src/cmd/avs/dsw/Makefile b/usr/src/cmd/avs/dsw/Makefile
index 8667b2feba..7dced4b925 100644
--- a/usr/src/cmd/avs/dsw/Makefile
+++ b/usr/src/cmd/avs/dsw/Makefile
@@ -51,10 +51,13 @@ POFILE = dsw_all.po
SRCS= $(OBJS:%.o=%.c)
POFILES= $(OBJS:%.o=%.po)
-CFLAGS += -v -D_DSW_
+CFLAGS += $(CCVERBOSE) -D_DSW_
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_DSW_ -DDEBUG
LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY
LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
all := TARGET= all
install := TARGET= install
diff --git a/usr/src/cmd/avs/errgen/Makefile b/usr/src/cmd/avs/errgen/Makefile
index a0d41ede51..f37035c367 100644
--- a/usr/src/cmd/avs/errgen/Makefile
+++ b/usr/src/cmd/avs/errgen/Makefile
@@ -31,6 +31,7 @@ PROG= $(DYNPROG)
OBJS= errgen.o
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
.KEEP_STATE:
diff --git a/usr/src/cmd/avs/ncall/Makefile b/usr/src/cmd/avs/ncall/Makefile
index c9c6d78735..30bffc0513 100644
--- a/usr/src/cmd/avs/ncall/Makefile
+++ b/usr/src/cmd/avs/ncall/Makefile
@@ -46,7 +46,8 @@ LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
LINTFLAGS += -erroff=E_BAD_FORMAT_ARG_TYPE2
LINTFLAGS += -erroff=E_FUNC_RET_ALWAYS_IGNOR2
LINTDIR = $(KBASE)/lintdir
-CFLAGS += -v -D_SYSCALL32 -D__NCALL__
+CFLAGS += $(CCVERBOSE) -D_SYSCALL32 -D__NCALL__
+CERRWARN += -_gcc=-Wno-uninitialized
ROOTLINK = $(ROOTLIB)/$(PROG)
all := TARGET= all
diff --git a/usr/src/cmd/avs/rdc/Makefile b/usr/src/cmd/avs/rdc/Makefile
index 92c2586136..1148884422 100644
--- a/usr/src/cmd/avs/rdc/Makefile
+++ b/usr/src/cmd/avs/rdc/Makefile
@@ -55,13 +55,16 @@ sndrboot := LDLIBS += -lrdc -lunistat -ldscfg
sndrd := LDLIBS += -lrdc -lnsl
sndrsyncd := LDLIBS += -lrdc -ldscfg -lunistat
-CFLAGS += -v -D_RDC_ -D_SYSCALL32
+CFLAGS += $(CCVERBOSE) -D_RDC_ -D_SYSCALL32
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user -D_RDC_ -D_SYSCALL32
LINTFLAGS += -DDEBUG
LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY
LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
LINTFLAGS += -erroff=E_FUNC_SET_NOT_USED
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
POFILE = rdc_all.po
POFILES = sndradm.po sndrboot.po
ROOTLIBLINKS = $(ROOTLIB)/sndrd $(ROOTLIB)/sndrsyncd
diff --git a/usr/src/cmd/avs/sdbc/Makefile b/usr/src/cmd/avs/sdbc/Makefile
index d14f03cb96..97cc48f5a1 100644
--- a/usr/src/cmd/avs/sdbc/Makefile
+++ b/usr/src/cmd/avs/sdbc/Makefile
@@ -59,7 +59,7 @@ sd_stats := LDLIBS += -lunistat -lcurses
sd_diag := LDLIBS += -lnsctl
sdbc_dynmem := LDLIBS += -lkstat
-CFLAGS += -v -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32
+CFLAGS += $(CCVERBOSE) -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32
CPPFLAGS += -DNSC_MULTI_TERABYTE
LINTFLAGS += -Xa -n -s -x -m -u -Dlint -errhdr=%user
LINTFLAGS += -D_SCM_ -D_SD_8K_BLKSIZE -D_SYSCALL32
@@ -68,6 +68,7 @@ LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
LINTFLAGS += -erroff=E_SEC_SCANF_UNBOUNDED_COPY
LINTFLAGS += -erroff=E_SEC_FORBIDDEN_WARN_ASCFTIME
LINTFLAGS += -DDEBUG
+CERRWARN += -_gcc=-Wno-uninitialized
ROOTLINK = $(ROOTUSRSBIN)/scmadm
all := TARGET= all
diff --git a/usr/src/cmd/awk/Makefile b/usr/src/cmd/awk/Makefile
index a437a67e97..f0261a4bf2 100644
--- a/usr/src/cmd/awk/Makefile
+++ b/usr/src/cmd/awk/Makefile
@@ -20,13 +20,10 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/awk/Makefile
-#
# NOTE: awk is oawk.
@@ -38,6 +35,13 @@ OBJS= $(OBJ2) $(OBJ1)
SRCS= $(OBJ1:%.o=%.c)
include ../Makefile.cmd
+
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# Message catalog
#
diff --git a/usr/src/cmd/awk_xpg4/Makefile b/usr/src/cmd/awk_xpg4/Makefile
index 55d83ec956..79a85e8d04 100644
--- a/usr/src/cmd/awk_xpg4/Makefile
+++ b/usr/src/cmd/awk_xpg4/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -43,6 +41,9 @@ include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
YFLAGS += -d
LDLIBS += -lm
CLEANFILES= awk.c y.tab.h
diff --git a/usr/src/cmd/backup/Makefile.backup b/usr/src/cmd/backup/Makefile.backup
index 6c6093396f..17d8986bf6 100644
--- a/usr/src/cmd/backup/Makefile.backup
+++ b/usr/src/cmd/backup/Makefile.backup
@@ -39,6 +39,11 @@ LINTFLAGS= -errchk=%all,longptr64 -errhdr=%user -F -m \
#CSTYLEFLAGS= -c -h -p -v -P
CSTYLEFLAGS= -h -p -P
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+
UFSROOTETC= $(ROOT)/etc
UFSROOTUSR= $(ROOT)/usr
UFSROOTUSRLIB= $(UFSROOTUSR)/lib
diff --git a/usr/src/cmd/backup/dump/Makefile b/usr/src/cmd/backup/dump/Makefile
index 849fbf4ef7..775127419f 100644
--- a/usr/src/cmd/backup/dump/Makefile
+++ b/usr/src/cmd/backup/dump/Makefile
@@ -67,6 +67,11 @@ GLOBAL= ../../../head
CPPFLAGS= -I$(LOCAL) -I$(GENERAL) -I$(GLOBAL) -DPARTIAL \
-I$(ROLLDIR) $(CPPFLAGS.master) \
-D_LARGEFILE64_SOURCE=1
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-extra
LIBDUMP= ../lib/libdump.a
LINTLIBDUMP= ../lib/llib-ldump.ln -lkstat
LDLIBS += $(BSTATIC) -L../lib -ldump $(BDYNAMIC) \
diff --git a/usr/src/cmd/backup/lib/Makefile b/usr/src/cmd/backup/lib/Makefile
index 9d02a60649..678c18d78c 100644
--- a/usr/src/cmd/backup/lib/Makefile
+++ b/usr/src/cmd/backup/lib/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libdump.a
@@ -65,6 +63,10 @@ POFILES= $(OBJECTS:.o=.po)
GENERAL= ../include
GLOBAL= ../../../head
CPPFLAGS= -I$(GENERAL) -I$(GLOBAL) $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
LINTOUT= lint.out
CLEANFILES= $(OBJECTS) $(LINTOUT) $(LINTLIB) $(DEBUGS) *.ln \
$(YSRC) $(LIBRARY)
diff --git a/usr/src/cmd/bart/Makefile b/usr/src/cmd/bart/Makefile
index eee36ba33e..e36bbe26cd 100644
--- a/usr/src/cmd/bart/Makefile
+++ b/usr/src/cmd/bart/Makefile
@@ -19,10 +19,9 @@
# CDDL HEADER END
#
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
+#
PROG= bart
SRCS= rules.c create.c compare.c main.c lutbl.c
@@ -30,7 +29,10 @@ OBJS= rules.o create.o compare.o main.o lutbl.o
BART= bart
include ../Makefile.cmd
+
LDLIBS += -lsec -lmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
#
# for messaging catalog
diff --git a/usr/src/cmd/bc/Makefile b/usr/src/cmd/bc/Makefile
index 54e11a7fe0..e910d2cd59 100644
--- a/usr/src/cmd/bc/Makefile
+++ b/usr/src/cmd/bc/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -37,6 +35,10 @@ CLOBBERFILES= $(LIBB)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+
$(XPG6EXOBJS) := CFLAGS += -DXPG6
ROOTLIBB= $(LIBB:%=$(ROOTLIB)/%)
$(ROOTLIBB) := FILEMODE = $(LIBFILEMODE)
diff --git a/usr/src/cmd/bdiff/Makefile b/usr/src/cmd/bdiff/Makefile
index 6e38d145f9..9ce2350115 100644
--- a/usr/src/cmd/bdiff/Makefile
+++ b/usr/src/cmd/bdiff/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989, 1996 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -32,7 +30,8 @@ include ../Makefile.cmd
FILEMODE= 755
-CPPFLAGS +=-D_FILE_OFFSET_BITS=64
+CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/beadm/Makefile b/usr/src/cmd/beadm/Makefile
index 7516dec014..8ea7ac8cae 100644
--- a/usr/src/cmd/beadm/Makefile
+++ b/usr/src/cmd/beadm/Makefile
@@ -31,6 +31,7 @@ POFILE= beadm.po
include ../Makefile.cmd
LDLIBS += -lnvpair -lbe
+CERRWARN += -_gcc=-Wno-parentheses
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
diff --git a/usr/src/cmd/bfs/Makefile b/usr/src/cmd/bfs/Makefile
index bc9004cbc0..fe0b1185b7 100644
--- a/usr/src/cmd/bfs/Makefile
+++ b/usr/src/cmd/bfs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -30,6 +28,9 @@ PROG= bfs
include ../Makefile.cmd
LDLIBS += -lgen
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/bnu/Makefile.inc b/usr/src/cmd/bnu/Makefile.inc
index b98f99e34e..a8642655c2 100644
--- a/usr/src/cmd/bnu/Makefile.inc
+++ b/usr/src/cmd/bnu/Makefile.inc
@@ -22,10 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# This file is included by Makefile. The idea is to unclutter it (Makefile).
-#
SRCS = account.c anlwrk.c bnuconvert.c callers.c \
chremdir.c cntrl.c conn.c cpmv.c ct.c \
@@ -43,7 +39,13 @@ SRCS = account.c anlwrk.c bnuconvert.c callers.c \
uuglist.c uuname.c uusched.c uustat.c uux.c \
uuxqt.c versys.c xio.c xqt.c \
../chmod/common.c
-
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
TLILIB = -lnsl -lsocket
PAMLIB = -lpam
diff --git a/usr/src/cmd/boot/bootadm/Makefile b/usr/src/cmd/boot/bootadm/Makefile
index 2b0d2cb358..e3f67930ff 100644
--- a/usr/src/cmd/boot/bootadm/Makefile
+++ b/usr/src/cmd/boot/bootadm/Makefile
@@ -46,6 +46,10 @@ CFLAGS += $(XSTRCONST)
CPPFLAGS += -D_FILE_OFFSET_BITS=64
CPPFLAGS += -I../../../uts/common -I../../../common
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2
LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
diff --git a/usr/src/cmd/boot/common/mboot_extra.c b/usr/src/cmd/boot/common/mboot_extra.c
index d8f5fa346d..170d638bb5 100644
--- a/usr/src/cmd/boot/common/mboot_extra.c
+++ b/usr/src/cmd/boot/common/mboot_extra.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -107,7 +108,7 @@ find_multiboot(char *buffer, uint32_t buf_size, uint32_t *mboot_off)
* + payload chunks), find the extended information structure.
*/
bblk_einfo_t *
-find_einfo(char *extra)
+find_einfo(char *extra, uint32_t size)
{
bb_header_ext_t *ext_header;
bblk_einfo_t *einfo;
@@ -116,6 +117,12 @@ find_einfo(char *extra)
assert(extra != NULL);
ext_header = (bb_header_ext_t *)extra;
+ if (ext_header->size > size) {
+ BOOT_DEBUG("Unable to find extended versioning information, "
+ "data size too big\n");
+ return (NULL);
+ }
+
cksum = compute_checksum(extra + sizeof (bb_header_ext_t),
ext_header->size);
BOOT_DEBUG("Extended information header checksum is %x\n", cksum);
diff --git a/usr/src/cmd/boot/common/mboot_extra.h b/usr/src/cmd/boot/common/mboot_extra.h
index ba60351718..fb48c52a69 100644
--- a/usr/src/cmd/boot/common/mboot_extra.h
+++ b/usr/src/cmd/boot/common/mboot_extra.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _MBOOT_EXTRA_H
@@ -46,7 +47,7 @@ typedef struct _bb_extra_header {
} bb_header_ext_t;
uint32_t compute_checksum(char *, uint32_t);
-bblk_einfo_t *find_einfo(char *);
+bblk_einfo_t *find_einfo(char *, uint32_t);
int find_multiboot(char *, uint32_t, uint32_t *);
void add_einfo(char *, char *, bblk_hs_t *, uint32_t);
int compare_bootblocks(char *, char *, char **);
diff --git a/usr/src/cmd/boot/installboot/Makefile b/usr/src/cmd/boot/installboot/Makefile
index 5dc4eb13b5..e2fcf37f84 100644
--- a/usr/src/cmd/boot/installboot/Makefile
+++ b/usr/src/cmd/boot/installboot/Makefile
@@ -40,6 +40,7 @@ C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/boot/installboot/installboot.c b/usr/src/cmd/boot/installboot/installboot.c
index cab6670608..2a4f48fd18 100644
--- a/usr/src/cmd/boot/installboot/installboot.c
+++ b/usr/src/cmd/boot/installboot/installboot.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -252,6 +253,8 @@ read_bootblock_from_disk(int dev_fd, ib_bootblock_t *bblock)
bblock->mboot = (multiboot_header_t *)(bblock->buf + bblock->mboot_off
+ BBLK_DATA_RSVD_SIZE);
bblock->extra = (char *)bblock->mboot + sizeof (multiboot_header_t);
+ bblock->extra_size = bblock->buf_size - bblock->mboot_off
+ - BBLK_DATA_RSVD_SIZE - sizeof (multiboot_header_t);
return (BC_SUCCESS);
}
@@ -279,7 +282,7 @@ is_update_necessary(ib_data_t *data, char *updt_str)
return (B_TRUE);
}
- einfo = find_einfo(bblock_disk.extra);
+ einfo = find_einfo(bblock_disk.extra, bblock_disk.extra_size);
if (einfo == NULL) {
BOOT_DEBUG("No extended information available\n");
return (B_TRUE);
@@ -716,7 +719,7 @@ handle_getinfo(char *progname, char **argv)
goto out_dev;
}
- einfo = find_einfo(bblock->extra);
+ einfo = find_einfo(bblock->extra, bblock->extra_size);
if (einfo == NULL) {
retval = BC_NOEINFO;
(void) fprintf(stderr, gettext("No extended information "
@@ -817,7 +820,7 @@ handle_mirror(char *progname, char **argv)
goto out_devs;
}
- einfo_curr = find_einfo(bblock_curr->extra);
+ einfo_curr = find_einfo(bblock_curr->extra, bblock_curr->extra_size);
if (einfo_curr != NULL)
updt_str = einfo_get_string(einfo_curr);
diff --git a/usr/src/cmd/boot/installboot/installboot.h b/usr/src/cmd/boot/installboot/installboot.h
index 7b558b3846..2fa7ad2561 100644
--- a/usr/src/cmd/boot/installboot/installboot.h
+++ b/usr/src/cmd/boot/installboot/installboot.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _INSTALLBOOT_H
@@ -52,6 +53,7 @@ typedef struct _ib_bootblock {
uint32_t mboot_off;
uint32_t buf_size;
uint32_t file_size;
+ uint32_t extra_size;
} ib_bootblock_t;
typedef struct _ib_data {
diff --git a/usr/src/cmd/boot/installgrub/Makefile b/usr/src/cmd/boot/installgrub/Makefile
index bf3d73ab70..4cc69eccd5 100644
--- a/usr/src/cmd/boot/installgrub/Makefile
+++ b/usr/src/cmd/boot/installgrub/Makefile
@@ -36,6 +36,9 @@ SBINLINKS= $(PROG)
include ../Makefile.com
CPPFLAGS += -I$(SRC)/uts/i86pc -I$(SRC)/uts/intel -I$(SRC)/uts/common
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lmd5
diff --git a/usr/src/cmd/boot/installgrub/installgrub.c b/usr/src/cmd/boot/installgrub/installgrub.c
index 3df067420c..c27dca802b 100644
--- a/usr/src/cmd/boot/installgrub/installgrub.c
+++ b/usr/src/cmd/boot/installgrub/installgrub.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2012 Milan Jurik. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -403,7 +404,7 @@ handle_getinfo(char *progname, char **argv)
goto out_dev;
}
- einfo = find_einfo(stage2->extra);
+ einfo = find_einfo(stage2->extra, stage2->extra_size);
if (einfo == NULL) {
retval = BC_NOEINFO;
(void) fprintf(stderr, gettext("No extended information "
@@ -501,7 +502,7 @@ handle_mirror(char *progname, char **argv)
goto out_devs;
}
- einfo_curr = find_einfo(stage2_curr->extra);
+ einfo_curr = find_einfo(stage2_curr->extra, stage2_curr->extra_size);
if (einfo_curr != NULL)
updt_str = einfo_get_string(einfo_curr);
@@ -1221,6 +1222,7 @@ read_stage2_from_disk(int dev_fd, ig_stage2_t *stage2)
stage2->mboot_off = mboot_off;
stage2->mboot = (multiboot_header_t *)(stage2->buf + stage2->mboot_off);
stage2->extra = stage2->buf + P2ROUNDUP(stage2->file_size, 8);
+ stage2->extra_size = stage2->buf_size - P2ROUNDUP(stage2->file_size, 8);
return (BC_SUCCESS);
}
@@ -1251,7 +1253,7 @@ is_update_necessary(ig_data_t *data, char *updt_str)
* Look for the extended information structure in the extra payload
* area.
*/
- einfo = find_einfo(stage2_disk.extra);
+ einfo = find_einfo(stage2_disk.extra, stage2_disk.extra_size);
if (einfo == NULL) {
BOOT_DEBUG("No extended information available\n");
return (B_TRUE);
diff --git a/usr/src/cmd/boot/installgrub/installgrub.h b/usr/src/cmd/boot/installgrub/installgrub.h
index e23d1c35d7..af6e60b973 100644
--- a/usr/src/cmd/boot/installgrub/installgrub.h
+++ b/usr/src/cmd/boot/installgrub/installgrub.h
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _INSTALLGRUB_H
@@ -53,6 +54,7 @@ typedef struct _stage2_data {
multiboot_header_t *mboot;
uint32_t mboot_off;
uint32_t file_size;
+ uint32_t extra_size;
uint32_t buf_size;
uint32_t first_sector;
uint32_t pcfs_first_sectors[2];
diff --git a/usr/src/cmd/boot/mbr/Makefile b/usr/src/cmd/boot/mbr/Makefile
index 510257daac..8f18eaee27 100644
--- a/usr/src/cmd/boot/mbr/Makefile
+++ b/usr/src/cmd/boot/mbr/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
BOOTPROG= mbr
@@ -32,6 +30,8 @@ SRCS = $(OBJS:.o=.c)
include ../Makefile.com
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(BOOTPROG)
diff --git a/usr/src/cmd/cal/Makefile b/usr/src/cmd/cal/Makefile
index c058060156..0cf3f27ba5 100644
--- a/usr/src/cmd/cal/Makefile
+++ b/usr/src/cmd/cal/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/cal/Makefile
PROG= cal
@@ -35,6 +32,8 @@ SED= sed
DCFILE= $(PROG).dc
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/calendar/Makefile b/usr/src/cmd/calendar/Makefile
index b65401d925..04aa6c8869 100644
--- a/usr/src/cmd/calendar/Makefile
+++ b/usr/src/cmd/calendar/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -31,6 +29,8 @@ CLOBBERFILES = $(SHFILE)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
.KEEP_STATE:
all: $(PROG) $(SHFILES)
diff --git a/usr/src/cmd/captoinfo/Makefile b/usr/src/cmd/captoinfo/Makefile
index 562f9690fa..45313d00dd 100644
--- a/usr/src/cmd/captoinfo/Makefile
+++ b/usr/src/cmd/captoinfo/Makefile
@@ -23,8 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= captoinfo
@@ -36,6 +34,7 @@ include ../Makefile.cmd
LDFLAGS += $(MAPFILE.INT:%=-M%)
LDLIBS += -lcurses
CPPFLAGS += -I../../lib/libcurses/screen
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/cdrw/Makefile b/usr/src/cmd/cdrw/Makefile
index 64e935b95c..cfda1f13c4 100644
--- a/usr/src/cmd/cdrw/Makefile
+++ b/usr/src/cmd/cdrw/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= cdrw
@@ -39,6 +37,8 @@ SRCS= $(OBJS:.o=.c)
LDLIBS += -lhal -lsecdb
NONLINTLDLIBS = -ldbus-1
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
CPPFLAGS += -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(HAL_DBUS_CPPFLAGS)
LINTFLAGS += -um
diff --git a/usr/src/cmd/chmod/Makefile b/usr/src/cmd/chmod/Makefile
index 5e6b3fe6c4..00788f1205 100644
--- a/usr/src/cmd/chmod/Makefile
+++ b/usr/src/cmd/chmod/Makefile
@@ -19,13 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/chmod/Makefile
-#
PROG= chmod
OBJS= $(PROG).o common.o
@@ -36,6 +32,8 @@ POFILES= $(OBJS:%.o=%.po)
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/usr/src/cmd/cmd-crypto/cryptoadm/Makefile b/usr/src/cmd/cmd-crypto/cryptoadm/Makefile
index e2cf6ee838..1f421601fc 100644
--- a/usr/src/cmd/cmd-crypto/cryptoadm/Makefile
+++ b/usr/src/cmd/cmd-crypto/cryptoadm/Makefile
@@ -40,6 +40,8 @@ POFILES = $(OBJS:%.o=%.po)
POFILE = $(PROG)_all.po
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lcryptoutil
diff --git a/usr/src/cmd/cmd-crypto/decrypt/Makefile.com b/usr/src/cmd/cmd-crypto/decrypt/Makefile.com
index adcb7d6f0b..f549085acf 100644
--- a/usr/src/cmd/cmd-crypto/decrypt/Makefile.com
+++ b/usr/src/cmd/cmd-crypto/decrypt/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = decrypt
@@ -40,6 +38,9 @@ CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lkmf -lpkcs11 -lcryptoutil
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-crypto/digest/Makefile.com b/usr/src/cmd/cmd-crypto/digest/Makefile.com
index 72e88d10a7..ecc0652cee 100644
--- a/usr/src/cmd/cmd-crypto/digest/Makefile.com
+++ b/usr/src/cmd/cmd-crypto/digest/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = digest
@@ -40,6 +38,8 @@ CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
CPPFLAGS +=-D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lkmf -lpkcs11 -lcryptoutil
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-crypto/pktool/Makefile b/usr/src/cmd/cmd-crypto/pktool/Makefile
index d0430a4107..d33a9d5cc9 100644
--- a/usr/src/cmd/cmd-crypto/pktool/Makefile
+++ b/usr/src/cmd/cmd-crypto/pktool/Makefile
@@ -52,6 +52,8 @@ CPPFLAGS += -I. -I$(KMFDIR)/include -I$(ADJUNCT_PROTO)/usr/include/libxml2 \
-I$(KMFDIR)/ber_der/inc
CFLAGS += $(CCVERBOSE) -DDEBUG
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
LDLIBS += -lkmf -lpkcs11 -lcryptoutil
diff --git a/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile b/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile
index 73ec4241c2..199f92807a 100644
--- a/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile
+++ b/usr/src/cmd/cmd-inet/lib/ipmgmtd/Makefile
@@ -38,6 +38,9 @@ ROOTCFGDIR= $(ROOTETC)/ipadm
ROOTCFGFILES= $(CFGFILES:%=$(ROOTCFGDIR)/%)
ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(ROOTCFGFILES) := OWNER= ipadm
$(ROOTCFGFILES) := GROUP= sys
$(ROOTCFGFILES) := FILEMODE= 644
diff --git a/usr/src/cmd/cmd-inet/lib/nwamd/Makefile b/usr/src/cmd/cmd-inet/lib/nwamd/Makefile
index fadaa28d85..28648b59bc 100644
--- a/usr/src/cmd/cmd-inet/lib/nwamd/Makefile
+++ b/usr/src/cmd/cmd-inet/lib/nwamd/Makefile
@@ -55,6 +55,11 @@ LDLIBS += -ldhcpagent -ldhcputil -ldladm -ldlpi -lgen \
-linetutil -lipadm -lkstat -lnsl -lnvpair -lnwam \
-lsecdb -lscf -lsocket -lsysevent -lumem -luutil
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-label
+
#
# Instrument with CTF data to ease debugging.
#
diff --git a/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile b/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile
index 5bc7b56a2b..34c68c967b 100644
--- a/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile
+++ b/usr/src/cmd/cmd-inet/sbin/dhcpagent/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = dhcpagent
ROOTFS_PROG = $(PROG)
@@ -39,6 +37,9 @@ SRCS = $(OBJS:%.o=%.c)
POFILES = $(OBJS:%.o=%.po)
XGETFLAGS += -a -x dhcpagent.xcl
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+
#
# to compile a debug version, do a `make COPTFLAG="-g -XO0"'
#
diff --git a/usr/src/cmd/cmd-inet/usr.bin/Makefile b/usr/src/cmd/cmd-inet/usr.bin/Makefile
index 9f44242ae9..3b01f3f109 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/Makefile
@@ -67,6 +67,9 @@ ROOTSUIDPROG= $(SUIDPROG:%=$(ROOTBIN)/%)
$(ROOTSUIDPROG) := FILEMODE= 04555
CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
# Eventually just plain CFLAGS should be += -v, but not until all in
# PROGS are lint clean.
diff --git a/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile b/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile
index 00a487f022..23766b3a65 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/chat/Makefile
@@ -2,8 +2,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= chat
OBJS= chat.o
@@ -13,6 +11,8 @@ include ../../../Makefile.cmd
CPPFLAGS += -DSOL2
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-trigraphs
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile b/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile
index 9bbee08d18..91b9e2e0d7 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/ftp/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = ftp
DEFAULTFILES = ftp.dfl
@@ -41,6 +39,11 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
LDLIBS += -lsocket -lnsl -lgss
# ftp defines its own delete and glob - localize all symbols to prevent a
diff --git a/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile b/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile
index 97e4d49863..e67f95d52c 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/nc/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= nc
OBJS= atomicio.o netcat.o socks.o strtonum.o
@@ -33,6 +31,7 @@ SRCS= $(OBJS:%.o=%.c)
include ../../../Makefile.cmd
LDLIBS += -lresolv -lsocket
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile b/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile
index 75d8f85858..d993fb7ec5 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/nca/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -47,6 +45,7 @@ LINTFLAGS += $(_EXTN)
INC_PATH += ../../../../uts/common/inet/nca -I.
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
CPPFLAGS += -I$(INC_PATH)
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
index 47d36f1c36..10f743130a 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/netstat/Makefile
@@ -46,6 +46,8 @@ OBJS= $(LOCALOBJS) $(COMMONOBJS) $(STAT_COMMON_OBJS)
SRCS= $(LOCALSRCS) $(COMMONSRCS) $(STAT_COMMON_SRCS)
CPPFLAGS += -DNDEBUG -I$(CMDINETCOMMONDIR) -I$(STATCOMMONDIR)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -ldhcpagent -lsocket -lnsl -lkstat -ltsnet -ltsol
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile b/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile
index 57b30cf3b5..324a3c4897 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/pppd/Makefile
@@ -50,6 +50,8 @@ OBJS += chap_ms.o
EXOBJS += mschap_test.o
CLOBBERFILES += mschap_test
+CERRWARN += -_gcc=-Wno-uninitialized
+
# This is used *only* for testing the portability of the libraries
# required for MS-CHAPv1. It is not needed in any normal system and
# is not built by default.
diff --git a/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile b/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile
index 2e7b195b37..c8a1732e45 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/pppdump/Makefile
@@ -11,6 +11,11 @@ include ../../../Makefile.cmd
CPPFLAGS += -DPPP_DEFS_IN_NET
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile b/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile
index 54381cfe6d..358b559a48 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/rdist/Makefile
@@ -47,6 +47,14 @@ CPPFLAGS += -I. -I$(CMDINETCOMMONDIR) \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5/include/krb5
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTSYMLINK= $(ROOT)/usr/ucb/$(PROG)
# conditional assignments
diff --git a/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile b/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile
index 0c96c11a97..4c17b1bbf4 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/talk/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -40,6 +38,7 @@ POFILE= talk.po
#
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP
LDLIBS += -lcurses -lsocket -lnsl
diff --git a/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile b/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile
index 8d5643aad2..967e6a1b6d 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/telnet/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= telnet
OBJS= telnet.o commands.o main.o network.o ring.o \
@@ -45,6 +43,12 @@ include ../../../Makefile.cmd
CPPFLAGS += -DKLUDGELINEMODE -DUSE_TERMIO -DENV_HACK -DOLD_ENVIRON
CPPFLAGS += $(AUTH_INCLUDES)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
LDLIBS += -lsocket -lnsl -ltermlib
LDLIBS += -lmech_krb5
LDFLAGS += $(KRUNPATH) -L$(ROOT)$(KLIBDIR_DO) -L$(ROOT)$(KLIBDIR_GL)
diff --git a/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile b/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile
index cf900fa602..d2b5c4d87c 100644
--- a/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.bin/tftp/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,2001 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -34,6 +32,8 @@ include ../../../Makefile.cmd
include ../../Makefile.cmd-inet
CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP -I$(CMDINETCOMMONDIR)
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lsocket -lnsl
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile
index 194afd44e6..f6c8f79b0c 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/dsvclockd/Makefile
@@ -23,8 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = dsvclockd
OBJS = dsvclockd.o container.o datastore.o
@@ -37,6 +35,7 @@ POFILES = $(OBJS:.o=.po)
LDLIBS += -ldhcputil -ldhcpsvc
CPPFLAGS += -D_REENTRANT
+CERRWARN += -_gcc=-Wno-parentheses
XGETFLAGS += -a
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile
index 4a4c482e3a..d00653d4eb 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/Makefile
@@ -49,6 +49,10 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CMDINETCOMMONDIR) -D_REENTRANT
CPPFLAGS += -I$(LIB_INC)
CPPFLAGS += -I$(SRC)/uts/common
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+
C99MODE = $(C99_ENABLE)
# I18n
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile
index e70830e8e8..30504eb2f5 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/ilbd/ilb/Makefile
@@ -36,6 +36,8 @@ all: $(PROG)
include ../../Makefile.lib
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTLIBINETILB = $(ROOTLIBINET)/ilb
ROOTLIBINETILBPROG = $(PROG:%=$(ROOTLIBINETILB)/%)
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile
index 3290764f9d..4b8b6a3678 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.dhcpd/Makefile
@@ -55,6 +55,10 @@ LDLIBS += $(NSU_DIR)/rfc2136.so.1 -ldhcpsvc -ldhcputil -linetutil \
-lsocket -lnsl -lmtmalloc -lresolv
lint := LDLIBS = $(LDLIBS.cmd) -ldhcpsvc -ldhcputil -linetutil -lsocket -lnsl
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+
#
# Debugging support; toggle on if needed.
#
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
index f3ce9fae4b..7f08f59b90 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.mpathd/Makefile
@@ -46,6 +46,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
LDLIBS += -lsocket -lnsl -lsysevent -lnvpair -lipmp -linetutil -ldlpi
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# Instrument in.mpathd with CTF data to ease debugging.
#
diff --git a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
index 542c79feb0..bc2815c8d7 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/in.ndpd/Makefile
@@ -56,6 +56,9 @@ LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_VAL_TYPE_DECL2
# perfect would require a bigger rewrite.
LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
CTFCONVERT_HOOK = && $(CTFCONVERT_O)
CTFMERGE_HOOK = && $(CTFMERGE) -L VERSION -o $@ $(OBJS)
$(OBJS) := CFLAGS += $(CTF_FLAGS)
diff --git a/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile
index 69a32aa834..2065957edf 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/inetd/Makefile
@@ -39,6 +39,9 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I$(CMDINETCOMMONDIR) -D_REENTRANT
$(RELEASE_BUILD)CPPFLAGS += -DNDEBUG
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-label
+
LDLIBS += -lsocket -lnsl -lrestart -lscf -lcontract -linetutil \
-lwrap -linetsvc -luutil -lumem -lbsm
diff --git a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile
index 5fde5a13c7..8fd9bcaf64 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/mdnsd/Makefile
@@ -48,6 +48,10 @@ MDNSFLAGS= -DNOT_HAVE_DAEMON -DNOT_HAVE_SA_LEN \
include ../../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTMANIFESTDIR= $(ROOTSVCNETWORKDNS)
$(ROOTMANIFEST) := FILEMODE= 444
diff --git a/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile
index 40216bd60d..81233c5994 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/ncaconfd/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 2000 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/cmd-inet/usr.lib/ncad/Makefile
-#
PROG = ncaconfd
@@ -40,6 +36,8 @@ include ../Makefile.lib
LDLIBS += -lsocket -lnsl
CPPFLAGS += -I$(SRC)/uts/common/inet/nca
+CERRWARN += -_gcc=-Wno-uninitialized
+
POFILE = ${PROG}.po
install: all $(ROOTLIBINETPROG)
diff --git a/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile b/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile
index 664c09c922..12a621d55f 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.lib/vrrpd/Makefile
@@ -47,6 +47,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=600 -D__EXTENSIONS__
LDLIBS += -lvrrpadm -lsocket -lnsl -ldladm -linetutil -lipadm -lsysevent -lnvpair -lsecdb
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2 -erroff=E_INCONS_ARG_USED2
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# Instrument vrrpd with CTF data to ease debugging.
#
diff --git a/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com b/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com
index b7472d34ae..aa9d03f162 100644
--- a/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com
+++ b/usr/src/cmd/cmd-inet/usr.lib/wanboot/Makefile.com
@@ -23,12 +23,12 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include $(SRC)/cmd/Makefile.cmd
ROOTCMDDIR = $(ROOT)/usr/lib/inet/wanboot
CMNCRYPTDIR = ../../../../../common/net/wanboot/crypt
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile
index a29bdf1caf..5ac8ee0d63 100644
--- a/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sadm/dhcpmgr/lib/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= dhcpmgr.a
VERS= .1
@@ -48,6 +46,9 @@ CPPFLAGS += -I../com/sun/dhcpmgr/bridge \
-I$(SRC)/common/net/dhcp \
-I.
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -ldhcpsvc -ldhcputil -linetutil -lscf -lsocket -lresolv -lnsl -lc
# definitions for i18n
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/Makefile
index 44ba61f7c1..3ad19659c5 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/Makefile
@@ -104,6 +104,15 @@ COMMONOBJS= addr_match.o kcmd.o store_forw_creds.o
COMMONSRCS= $(COMMONOBJS:%.o=$(CMDINETCOMMONDIR)/%.c)
SRCS+= $(COMMONSRCS)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-address
+
#
# Message catalog
#
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile
index 259836d39b..ca3917bdac 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/htable/Makefile
@@ -20,11 +20,8 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/cmd-inet/usr.sbin/htable/Makefile
PROG= htable
OBJS= htable.o parse.o scan.o
@@ -36,6 +33,11 @@ CPPFLAGS += -DSYSV -DSTRNET -DBSD_COMP
LDLIBS += -lsocket -lnsl
YFLAGS += -d
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile
index 9144fb1439..2f5b321f63 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/Makefile
@@ -37,6 +37,8 @@ COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
SRCS= $(LOCALSRCS) $(COMMONSRCS)
CPPFLAGS += -I$(CMDINETCOMMONDIR) -I$(SRC)/common/net/dhcp
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -ldhcpagent -ldlpi -linetutil -lipmp -ldladm -lipadm
LINTFLAGS += -m
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile
index 5b4954d341..a3afee1f15 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ilbadm/Makefile
@@ -35,6 +35,10 @@ include ../../Makefile.cmd-inet
LDLIBS += -lcmdutils -lsocket -lnsl -lilb -linetutil -lkstat
CPPFLAGS += -I$(SRC)/lib/libilb/common -I$(SRC)/uts/common
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
C99MODE = $(C99_ENABLE)
POFILES = $(OBJS:%.o=%.po)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
index c20b6fe882..c28648fb35 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.ftpd/Makefile
@@ -46,6 +46,14 @@ CPPFLAGS += -DBSD_COMP -D_FILE_OFFSET_BITS=64 -DINET6 -DSOLARIS_BSM_AUDIT \
LDLIBS += -lsocket -lnsl -lpam -lbsm -lsendfile -lgss
YFLAGS += -d
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-address
+
in.ftpd := LDFLAGS += $(MAPFILE.NGB:%=-M%)
# tcov output relies on atexit(3C) registered functions being called, so stop
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile
index 63f1fb1fb6..4a001e9c16 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.rdisc/Makefile
@@ -21,8 +21,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= in.rdisc
MANIFEST= rdisc.xml
@@ -35,6 +33,7 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKROUTING)
LDLIBS += -lsocket -lnsl
CPPFLAGS += -DSYSV -DBSD_COMP
+CERRWARN += -_gcc=-Wno-extra
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile
index ad125b5a3f..8159456d34 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.routed/Makefile
@@ -37,6 +37,8 @@ LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_VAL_TYPE_DECL2 \
CPPFLAGS += $(_D_XOPEN_EXTN)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lxnet -lmd -lsocket
CLEAN_FILES += $(ROUTEDOBJS) $(RTQUERYOBJS)
CLOBBERFILES += $(ROUTEDPROG) $(RTQUERYPROG)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile
index 0d9a813d9f..27e0ea85ab 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/in.talkd/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -36,6 +34,8 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
$(ROOTMANIFEST) := FILEMODE= 444
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lsocket -lnsl
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile
index a682c85296..55cbbf7aab 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/inetadm/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
PROG = inetadm
SRCS = inetadm.c
@@ -33,6 +32,8 @@ OBJS = $(SRCS:%.c=%.o)
include ../../../Makefile.cmd
LDLIBS += -lscf -luutil -linetsvc
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
lint := LINTFLAGS = -ux
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile
index 4de2d22645..acd230f592 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/inetconv/Makefile
@@ -23,14 +23,13 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = inetconv
include ../../../Makefile.cmd
LDLIBS += -lscf -linetsvc
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile
index 94b41cfaaa..57ae86b9e6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipadm/Makefile
@@ -39,6 +39,8 @@ COMMONSRCS= $(CMDINETCOMMONDIR)/$(COMMONOBJS:%.o=%.c)
SRCS= $(LOCALSRCS) $(COMMONSRCS)
CPPFLAGS += -I$(CMDINETCOMMONDIR)
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -linetutil -lipadm -lnvpair
LINTFLAGS += -m
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile
index fb30e8af09..f070273015 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipmpstat/Makefile
@@ -29,6 +29,7 @@ ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
include $(SRC)/cmd/Makefile.cmd
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lipmp -lsocket -lsysevent -lnvpair -linetutil
XGETFLAGS += -a -x $(PROG).xcl
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile
index 605ef68f99..28dd4654f6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipqosconf/Makefile
@@ -51,6 +51,9 @@ $(ROOTLIBIPQOSCONFTYPES) := FILEMODE= 0444
#pull in prototype for strtok_r
CPPFLAGS += -D__EXTENSIONS__
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lsocket -lnsl -lnvpair -lipp
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile
index e82bfdf215..2433e90df6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ipsecutils/Makefile
@@ -55,6 +55,9 @@ CLOBBERFILES += $(PROG) $(POFILES)
CLEANFILES += $(PROG) $(POFILES)
CPPFLAGS += -DSYSV -DBSD_COMP -I$(CMDINETCOMMONDIR) -I.
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
CFLAGS += $(XSTRCONST)
LDLIBS += -lipsecutil -lnsl
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile
index cf51abee85..4abf5b25f6 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/kssl/kssladm/Makefile
@@ -42,6 +42,8 @@ ROOTUSRLIBPROG = $(PROG:%=$(ROOTLIB)/%)
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
LDLIBS += -lkmf -lpkcs11 -lcryptoutil -lnsl -lsocket
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile
index d98073fe6d..87c91b39eb 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamadm/Makefile
@@ -33,6 +33,9 @@ include ../../../Makefile.cmd
XGETFLAGS += -a -x $(PROG).xcl
LDLIBS += -linetutil -lnsl -lnwam -lumem -lscf
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile
index 7f32e692ee..627a311076 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/nwamcfg/Makefile
@@ -36,6 +36,12 @@ LDLIBS += -ll -ltecla -lnwam -lumem
YFLAGS += -d -b nwamcfg_grammar
CLEANFILES += nwamcfg_lex.c nwamcfg_grammar.tab.c nwamcfg_grammar.tab.h
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
index 0d5c086124..88f36be473 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/ping/Makefile
@@ -48,6 +48,8 @@ CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
# when running lint.
LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2 -erroff=E_INCONS_ARG_DECL2
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
.PARALLEL:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile
index 69f1177a5f..bd235b77b9 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/routeadm/Makefile
@@ -49,6 +49,8 @@ $(ROOTSVCMANIFESTS) := FILEMODE= 444
ROOTUSRSBINLINKS= $(PROG:%=$(ROOTUSRSBIN)/%)
CPPFLAGS += -I../../../../common/svc -I$(CMDINETCOMMONDIR)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
LDLIBS += -lscf -luutil -lsocket
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile
index 49a846e411..cfd939e905 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/snoop/Makefile
@@ -49,6 +49,15 @@ include ../../../Makefile.cmd
CPPFLAGS += -I. -I$(SRC)/common/net/dhcp
LDLIBS += -ldhcputil -ldlpi -lsocket -lnsl -ltsol
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
.KEEP_STATE:
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
index f2913a2ed4..b3fa1a473a 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/traceroute/Makefile
@@ -52,6 +52,9 @@ CPPFLAGS += -D_XOPEN_SOURCE=500 -D__EXTENSIONS__
LINTFLAGS += -erroff=E_FUNC_DECL_VAR_ARG2 -erroff=E_INCONS_ARG_DECL2 \
-erroff=E_INCONS_ARG_USED2 -erroff=E_INCONS_VAL_TYPE_DECL2
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile b/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile
index 41d2b6eb42..b5732647eb 100644
--- a/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile
+++ b/usr/src/cmd/cmd-inet/usr.sbin/wificonfig/Makefile
@@ -23,10 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/cmd-inet/usr.sbin/wificonfig/Makefile
-#
PROG= wificonfig
OBJS= wificonfig.o
@@ -38,6 +34,8 @@ LDLIBS += -lsecdb
$(ROOTSBIN)/wificonfig := FILEMODE = 04755
ROOTUSRSBINLINKS = $(ROOTUSRSBIN)/$(PROG)
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/compress/Makefile b/usr/src/cmd/compress/Makefile
index ea306d8cc2..310337fb1f 100644
--- a/usr/src/cmd/compress/Makefile
+++ b/usr/src/cmd/compress/Makefile
@@ -1,5 +1,4 @@
#
-#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
@@ -19,9 +18,7 @@
#
# CDDL HEADER END
#
-#
-#ident "%Z%%M% %I% %E% SMI"
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
@@ -36,6 +33,8 @@ include ../Makefile.cmd
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
LINTFLAGS += -u
diff --git a/usr/src/cmd/consadm/Makefile.com b/usr/src/cmd/consadm/Makefile.com
index 9eb1226b74..135b5d9a8f 100644
--- a/usr/src/cmd/consadm/Makefile.com
+++ b/usr/src/cmd/consadm/Makefile.com
@@ -33,6 +33,7 @@ OBJS= $(COMMONOBJS)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS +=
FILEMODE = 0555
diff --git a/usr/src/cmd/cpc/cpustat/Makefile b/usr/src/cmd/cpc/cpustat/Makefile
index bddb25db49..1bf30678cd 100644
--- a/usr/src/cmd/cpc/cpustat/Makefile
+++ b/usr/src/cmd/cpc/cpustat/Makefile
@@ -36,6 +36,7 @@ STAT_COMMON_SRCS = $(STAT_COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c)
SRCS += $(STAT_COMMON_SRCS)
CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_REENTRANT -I$(SRC)/lib/libcpc/common -I$(STATCOMMONDIR)
LDLIBS += -lcpc -lkstat
diff --git a/usr/src/cmd/cpio/Makefile b/usr/src/cmd/cpio/Makefile
index 8fccb059c4..3acc24cebd 100644
--- a/usr/src/cmd/cpio/Makefile
+++ b/usr/src/cmd/cpio/Makefile
@@ -29,6 +29,8 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DSOLARIS_PRIVS
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lsec -lcmdutils -lnvpair
XGETFLAGS += -a -x cpio.xcl
diff --git a/usr/src/cmd/cron/Makefile b/usr/src/cmd/cron/Makefile
index ce64d5a69b..c9ffeadffe 100644
--- a/usr/src/cmd/cron/Makefile
+++ b/usr/src/cmd/cron/Makefile
@@ -33,6 +33,11 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
ROOTMETHOD = $(ROOTLIBSVCMETHOD)/svc-cron
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-value
ROOTVAR = $(ROOT)/var
diff --git a/usr/src/cmd/cron/cron.c b/usr/src/cmd/cron/cron.c
index 5dd41f63e7..347b03287a 100644
--- a/usr/src/cmd/cron/cron.c
+++ b/usr/src/cmd/cron/cron.c
@@ -3111,7 +3111,7 @@ logit(int cc, struct runinfo *rp, int rc)
if (cc == BCHAR)
(void) printf("%c CMD: %s\n", cc, next_event->cmd);
(void) strftime(timebuf, sizeof (timebuf), FORMAT, localtime(&t));
- (void) printf("%c %.8s %u %c %s",
+ (void) printf("%c %s %u %c %s",
cc, (rp->rusr)->name, rp->pid, QUE(rp->que), timebuf);
if ((ret = TSTAT(rc)) != 0)
(void) printf(" ts=%d", ret);
diff --git a/usr/src/cmd/cron/cron.h b/usr/src/cmd/cron/cron.h
index ae8d2142de..93e21e7b41 100644
--- a/usr/src/cmd/cron/cron.h
+++ b/usr/src/cmd/cron/cron.h
@@ -26,6 +26,8 @@
#ifndef _CRON_H
#define _CRON_H
+#include <unistd.h>
+
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
@@ -53,8 +55,11 @@ extern "C" {
#define RCODE(x) (((x)>>8)&0377)
#define TSTAT(x) ((x)&0377)
-#define FLEN 15
-#define LLEN 9
+/* This constant must be at least sysconf(_SC_LOGIN_NAME_MAX) in size */
+#define UNAMESIZE 32 /* max chars in a user name */
+
+#define FLEN UNAMESIZE
+#define LLEN UNAMESIZE
/*
* structure used for passing messages from the at and crontab commands to cron
@@ -88,7 +93,6 @@ struct message {
#define ENV_HOME "HOME="
#define CTLINESIZE 1000 /* max chars in a crontab line */
-#define UNAMESIZE 20 /* max chars in a user name */
extern int allowed(char *, char *, char *);
extern int days_in_mon(int, int);
diff --git a/usr/src/cmd/cron/funcs.c b/usr/src/cmd/cron/funcs.c
index aa479fcbde..f907d439cb 100644
--- a/usr/src/cmd/cron/funcs.c
+++ b/usr/src/cmd/cron/funcs.c
@@ -172,8 +172,8 @@ cron_sendmsg(char action, char *login, char *fname, char etype)
}
pmsg->etype = etype;
pmsg->action = action;
- (void) strncpy(pmsg->fname, fname, FLEN);
- (void) strncpy(pmsg->logname, login, LLEN);
+ (void) strlcpy(pmsg->fname, fname, FLEN);
+ (void) strlcpy(pmsg->logname, login, LLEN);
if ((i = write(msgfd, pmsg, sizeof (struct message))) < 0)
(void) fprintf(stderr, gettext("error in message send\n"));
else if (i != sizeof (struct message))
diff --git a/usr/src/cmd/csh/i386/Makefile b/usr/src/cmd/csh/i386/Makefile
index 36ee788fc0..5f05c1b91f 100644
--- a/usr/src/cmd/csh/i386/Makefile
+++ b/usr/src/cmd/csh/i386/Makefile
@@ -24,6 +24,16 @@ CPPFLAGS += -I../../sh
CPPFLAGS += -D_FILE_OFFSET_BITS=64
LDLIBS += -lcurses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-int
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-extra
+
MAPFILES = ../mapfile-intf $(MAPFILE.NGB)
LDFLAGS += $(MAPFILES:%=-M%)
diff --git a/usr/src/cmd/csh/sparc/Makefile b/usr/src/cmd/csh/sparc/Makefile
index 37c536f83e..df03abd8a7 100644
--- a/usr/src/cmd/csh/sparc/Makefile
+++ b/usr/src/cmd/csh/sparc/Makefile
@@ -22,6 +22,16 @@ DEFS = -DVFORK -DFILEC -DBSD_COMP -DFIVE # No TELL when MBCHAR
CPPFLAGS= -I. $(DEFS) $(MBCHAR) $(CPPFLAGS.master)
CPPFLAGS += -I../../sh
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-int
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-extra
+
LDLIBS += -lcurses
MAPFILES = ../mapfile-intf $(MAPFILE.NGB)
diff --git a/usr/src/cmd/csplit/Makefile b/usr/src/cmd/csplit/Makefile
index d5f55c341e..66e008958a 100644
--- a/usr/src/cmd/csplit/Makefile
+++ b/usr/src/cmd/csplit/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -34,6 +32,9 @@ LDLIBS += -lgen
XGETFLAGS += -a -x csplit.xcl
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/ctrun/Makefile b/usr/src/cmd/ctrun/Makefile
index 118c11a8d8..318c7e0874 100644
--- a/usr/src/cmd/ctrun/Makefile
+++ b/usr/src/cmd/ctrun/Makefile
@@ -24,13 +24,13 @@
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-
PROG= ctrun
include ../Makefile.cmd
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lcontract -luutil
.KEEP_STATE:
diff --git a/usr/src/cmd/ctstat/Makefile b/usr/src/cmd/ctstat/Makefile
index 8f84632dc6..85bac9d29a 100644
--- a/usr/src/cmd/ctstat/Makefile
+++ b/usr/src/cmd/ctstat/Makefile
@@ -36,7 +36,8 @@ STAT_COMMON_SRCS = $(STAT_COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c)
SRCS += $(STAT_COMMON_SRCS)
CPPFLAGS += -I$(STATCOMMONDIR)
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lcontract -luutil
.KEEP_STATE:
diff --git a/usr/src/cmd/ctwatch/Makefile b/usr/src/cmd/ctwatch/Makefile
index 3ec60bcd16..ac93abb983 100644
--- a/usr/src/cmd/ctwatch/Makefile
+++ b/usr/src/cmd/ctwatch/Makefile
@@ -24,13 +24,12 @@
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-
PROG= ctwatch
include ../Makefile.cmd
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lcontract -luutil
.KEEP_STATE:
diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile
index 69d5697a4e..05c02a9d28 100644
--- a/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile
+++ b/usr/src/cmd/cvcd/sparc/sun4u/starcat/Makefile
@@ -42,6 +42,8 @@ FILEMODE= 0755
ROOTPSMPROG = $(ROOT_PSM_LIB_DIR)/$(PROG)
CPPFLAGS = -I$(USR_PSM_INCL_DIR) -I$(SRC)/uts/sun4u/starcat $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lsocket
diff --git a/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile b/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile
index 2e383ae249..1ec26f96d7 100644
--- a/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile
+++ b/usr/src/cmd/cvcd/sparc/sun4u/starfire/Makefile
@@ -42,6 +42,7 @@ FILEMODE= 0700
ROOTPSMPROG = $(ROOT_PSM_LIB_DIR)/$(PROG)
CPPFLAGS = -I$(USR_PSM_INCL_DIR) $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-unused-variable
LDLIBS += -lsocket -lnsl
diff --git a/usr/src/cmd/date/date.c b/usr/src/cmd/date/date.c
index d09be9c501..617de3b8a5 100644
--- a/usr/src/cmd/date/date.c
+++ b/usr/src/cmd/date/date.c
@@ -24,7 +24,7 @@
* Use is subject to license terms.
*/
/*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
*/
/*
* Copyright (c) 2012, Joyent, Inc. All rights reserved.
@@ -70,7 +70,7 @@ static struct utmpx wtmpx[2] = {
{"", "", NTIME_MSG, 0, NEW_TIME, 0, 0, 0}
};
static char *usage =
- "usage:\tdate [-u] mmddHHMM[[cc]yy][.SS]\n\tdate [-u] [+format]\n"
+ "usage:\tdate [-u] mmddHHMM[[cc]yy][.SS]\n\tdate [-Ru] [+format]\n"
"\tdate -a [-]sss[.fff]\n";
static int uflag = 0;
static int Rflag = 0;
diff --git a/usr/src/cmd/dc/Makefile b/usr/src/cmd/dc/Makefile
index 942c4fd993..50f4a4e60f 100644
--- a/usr/src/cmd/dc/Makefile
+++ b/usr/src/cmd/dc/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -34,6 +32,10 @@ XPG6EXOBJS= exobjs.xpg6/dc.o
include ../Makefile.cmd
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/dcs/sparc/sun4u/Makefile b/usr/src/cmd/dcs/sparc/sun4u/Makefile
index 76ff6c0a22..909bfa3040 100644
--- a/usr/src/cmd/dcs/sparc/sun4u/Makefile
+++ b/usr/src/cmd/dcs/sparc/sun4u/Makefile
@@ -89,6 +89,8 @@ LINT_FLAGS= -c -Nlevel=4 -Ncheck $($(CONCURR_MODE)_FLAGS)
XGETFLAGS += -a -s -x $(PROG).xcl
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
#
# LIBRARIES:
diff --git a/usr/src/cmd/dd/Makefile b/usr/src/cmd/dd/Makefile
index 8e056a6230..4088622905 100644
--- a/usr/src/cmd/dd/Makefile
+++ b/usr/src/cmd/dd/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -31,6 +29,7 @@ PROG= dd
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_FILE_OFFSET_BITS=64
.KEEP_STATE:
diff --git a/usr/src/cmd/deroff/Makefile b/usr/src/cmd/deroff/Makefile
index 6f79a1a4d9..6f08eb2b86 100644
--- a/usr/src/cmd/deroff/Makefile
+++ b/usr/src/cmd/deroff/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,10 @@ PROG= deroff
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/devctl/Makefile b/usr/src/cmd/devctl/Makefile
index ca84aa1ca2..98ba25c5c8 100644
--- a/usr/src/cmd/devctl/Makefile
+++ b/usr/src/cmd/devctl/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= devctl
@@ -33,6 +31,7 @@ include ../Makefile.cmd
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -ldevice -l devinfo
all: $(PROG)
diff --git a/usr/src/cmd/devfsadm/Makefile.com b/usr/src/cmd/devfsadm/Makefile.com
index 11fa66238e..fe4363e13b 100644
--- a/usr/src/cmd/devfsadm/Makefile.com
+++ b/usr/src/cmd/devfsadm/Makefile.com
@@ -94,6 +94,10 @@ LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
LINTFLAGS += -erroff=E_NAME_MULTIPLY_DEF2
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+
# Define the dependencies required by devfsadm and all shared objects.
LDLIBS += -ldevinfo
devfsadm := LDLIBS += -lgen -lsysevent -lnvpair -lzonecfg -lbsm
diff --git a/usr/src/cmd/devinfo/Makefile b/usr/src/cmd/devinfo/Makefile
index ac2ca7c8a7..58b5c56131 100644
--- a/usr/src/cmd/devinfo/Makefile
+++ b/usr/src/cmd/devinfo/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3.3.1 */
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -34,6 +32,7 @@ include ../Makefile.cmd
LDLIBS += -ladm -lefi
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/devmgmt/cmds/Makefile b/usr/src/cmd/devmgmt/cmds/Makefile
index 6fff60a376..56bd277ec8 100644
--- a/usr/src/cmd/devmgmt/cmds/Makefile
+++ b/usr/src/cmd/devmgmt/cmds/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/devmgmt/cmds/Makefile
-#
include ../../Makefile.cmd
@@ -39,6 +35,9 @@ PROG = devattr devreserv getvol putdgrp devfree getdev listdgrp getdgrp \
LDLIBS += -ladm
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
.PARALLEL: $(PROG)
diff --git a/usr/src/cmd/dfs.cmds/dfshares/Makefile b/usr/src/cmd/dfs.cmds/dfshares/Makefile
index ba59eaae5f..7134e8e4d7 100644
--- a/usr/src/cmd/dfs.cmds/dfshares/Makefile
+++ b/usr/src/cmd/dfs.cmds/dfshares/Makefile
@@ -20,12 +20,8 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/dfs.cmds/dfshares/Makefile
-#
PROG= dfshares
@@ -37,6 +33,9 @@ CFLAGS += -s
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/dfs.cmds/general/Makefile b/usr/src/cmd/dfs.cmds/general/Makefile
index c2d36aa4b2..d646d4142e 100644
--- a/usr/src/cmd/dfs.cmds/general/Makefile
+++ b/usr/src/cmd/dfs.cmds/general/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/dfs.cmds/general/Makefile
-#
# "general" is intended to be a generic way to invoke a filesystem-specific
# command, but at the moment, only /usr/sbin/unshare uses this facility.
# Until someone else needs this functionality, this will be turned off
@@ -46,6 +42,8 @@ CFLAGS += -s
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/dfs.cmds/sharectl/Makefile.com b/usr/src/cmd/dfs.cmds/sharectl/Makefile.com
index f890e6eb97..1651a72089 100644
--- a/usr/src/cmd/dfs.cmds/sharectl/Makefile.com
+++ b/usr/src/cmd/dfs.cmds/sharectl/Makefile.com
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -42,6 +40,8 @@ MYCPPFLAGS = -I.. -I../../sharemgr
CPPFLAGS += $(MYCPPFLAGS)
LDLIBS += -lshare -lumem
+CERRWARN += -_gcc=-Wno-uninitialized
+
SRCS = $(SHARECTL_SRC)
OBJS = $(SHARECTL_OBJ)
MODS = $(SHARECTL_MOD)
diff --git a/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com b/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com
index 4e9364a9c7..49272439c6 100644
--- a/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com
+++ b/usr/src/cmd/dfs.cmds/sharemgr/Makefile.com
@@ -43,6 +43,8 @@ LDLIBS += -lshare -lscf -lsecdb -lumem
all install := LDLIBS += -lxml2
LINTFLAGS += -u
+CERRWARN += -_gcc=-Wno-uninitialized
+
POFILES = $(SRCS:.c=.po)
POFILE = sharemgr.po
diff --git a/usr/src/cmd/diff/Makefile b/usr/src/cmd/diff/Makefile
index d5443bb3d3..cfa0ab04d2 100644
--- a/usr/src/cmd/diff/Makefile
+++ b/usr/src/cmd/diff/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -31,6 +29,11 @@ BINDIFF= diff
LIBDIFFH= diffh
include ../Makefile.cmd
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
#
# for messaging catalog
#
diff --git a/usr/src/cmd/diff3/Makefile b/usr/src/cmd/diff3/Makefile
index 7f542ea840..01de31d8cb 100644
--- a/usr/src/cmd/diff3/Makefile
+++ b/usr/src/cmd/diff3/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -31,6 +29,8 @@ CLOBBERFILES = $(SHFILES)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG) $(SHFILES)
diff --git a/usr/src/cmd/dis/Makefile b/usr/src/cmd/dis/Makefile
index 3d07482c10..56721a28af 100644
--- a/usr/src/cmd/dis/Makefile
+++ b/usr/src/cmd/dis/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
PROG= dis
OBJS= dis_target.o dis_main.o dis_util.o dis_list.o
@@ -31,6 +30,7 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
LDLIBS += -ldisasm -luutil -lelf
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/dispadmin/Makefile b/usr/src/cmd/dispadmin/Makefile
index 513dca10b4..65f7e7301c 100644
--- a/usr/src/cmd/dispadmin/Makefile
+++ b/usr/src/cmd/dispadmin/Makefile
@@ -39,6 +39,7 @@ PROGS= $(PROG) $(RT) $(TS) $(IA) $(FSS) $(FX) $(SDC)
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
ROOTDIR= $(ROOT)/usr/lib/class
ROOTDIRS= $(ROOTDIR) \
diff --git a/usr/src/cmd/dladm/Makefile b/usr/src/cmd/dladm/Makefile
index 657ceee889..143086e26a 100644
--- a/usr/src/cmd/dladm/Makefile
+++ b/usr/src/cmd/dladm/Makefile
@@ -37,6 +37,10 @@ LDLIBS += -L$(ROOT)/lib -lsocket
LDLIBS += -ldladm -ldlpi -lkstat -lsecdb -lbsm -linetutil -ldevinfo
LDLIBS += $(ZLAZYLOAD) -lrstp $(ZNOLAZYLOAD)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
# For headers from librstp.
LINTFLAGS += -erroff=E_TRAILING_COMMA_IN_ENUM
diff --git a/usr/src/cmd/dlmgmtd/Makefile b/usr/src/cmd/dlmgmtd/Makefile
index 1eb82565c9..ee51fd8cd2 100644
--- a/usr/src/cmd/dlmgmtd/Makefile
+++ b/usr/src/cmd/dlmgmtd/Makefile
@@ -40,6 +40,9 @@ $(ROOTCFGDIR)/datalink.conf := FILEMODE= 644
LDLIBS += -ldladm -ldlpi -lavl -lnvpair -lsysevent -lcontract
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# Instrument dlmgmtd with CTF data to ease debugging.
#
diff --git a/usr/src/cmd/dlstat/Makefile b/usr/src/cmd/dlstat/Makefile
index 8885dbc5a0..c37982a686 100644
--- a/usr/src/cmd/dlstat/Makefile
+++ b/usr/src/cmd/dlstat/Makefile
@@ -30,6 +30,11 @@ ROOTFS_PROG= $(PROG)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
XGETFLAGS += -a -x $(PROG).xcl
LDLIBS += -L$(ROOT)/lib
LDLIBS += -ldladm -linetutil
diff --git a/usr/src/cmd/drd/Makefile b/usr/src/cmd/drd/Makefile
index 862c8102b4..fe417b2028 100644
--- a/usr/src/cmd/drd/Makefile
+++ b/usr/src/cmd/drd/Makefile
@@ -23,7 +23,7 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
+
#
# Makefile definitions for sun4v DR Daemon (drd)
#
@@ -63,6 +63,8 @@ LINT_FLAGS= -c -Nlevel=4 -Ncheck
XGETFLAGS += -a -s -x $(PROG).xcl
+CERRWARN += -_gcc=-Wno-parentheses
+
#
# LIBRARIES:
diff --git a/usr/src/cmd/dtrace/test/cmd/baddof/Makefile b/usr/src/cmd/dtrace/test/cmd/baddof/Makefile
index bb7a746db7..4162cda817 100644
--- a/usr/src/cmd/dtrace/test/cmd/baddof/Makefile
+++ b/usr/src/cmd/dtrace/test/cmd/baddof/Makefile
@@ -23,7 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
include $(SRC)/cmd/Makefile.cmd
@@ -39,6 +38,8 @@ LDLIBS += -ldtrace
SRCS = baddof
CMDS = $(SRCS:%=$(ROOTBIN)/%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
$(CMDS) := FILEMODE = 0555
all: $(SRCS)
diff --git a/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile b/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile
index 6c3257df0b..789bd0510e 100644
--- a/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile
+++ b/usr/src/cmd/dtrace/test/cmd/badioctl/Makefile
@@ -23,7 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
include $(SRC)/cmd/Makefile.cmd
@@ -38,6 +37,9 @@ LDLIBS = $(LDLIBS.cmd)
SRCS = badioctl
CMDS = $(SRCS:%=$(ROOTBIN)/%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+
$(CMDS) := FILEMODE = 0555
all: $(SRCS)
diff --git a/usr/src/cmd/dtrace/test/tst/Makefile.com b/usr/src/cmd/dtrace/test/tst/Makefile.com
index e3cfd0ad0d..d4b787d5ec 100644
--- a/usr/src/cmd/dtrace/test/tst/Makefile.com
+++ b/usr/src/cmd/dtrace/test/tst/Makefile.com
@@ -60,6 +60,12 @@ $(ROOT_EXES) := FILEMODE = 0555
# in an arms race with increasingly belligerent optimizers.
COPTFLAG= -xO0
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+
all: $(EXES)
clean lint:
diff --git a/usr/src/cmd/du/Makefile b/usr/src/cmd/du/Makefile
index 4ddc1646ef..35b414e6cd 100644
--- a/usr/src/cmd/du/Makefile
+++ b/usr/src/cmd/du/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,6 +30,8 @@ XPG4PROG= du
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
$(XPG4) := CFLAGS += -DXPG4
CPPFLAGS += -D_FILE_OFFSET_BITS=64
POFILE = du_cmd.po
diff --git a/usr/src/cmd/ed/Makefile b/usr/src/cmd/ed/Makefile
index 8dbd627997..a5f6cef95a 100644
--- a/usr/src/cmd/ed/Makefile
+++ b/usr/src/cmd/ed/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= ed
XPG4PROG= ed
@@ -40,6 +38,10 @@ POFILES= $(EDOBJ:%.o=%.po)
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
$(XPG4) := CFLAGS += -DXPG4
$(XPG6) := CFLAGS += -DXPG6 -I$(SRC)/lib/libc/inc
lint := LDLIBS += -lgen -lcrypt
diff --git a/usr/src/cmd/eeprom/Makefile.com b/usr/src/cmd/eeprom/Makefile.com
index 2c2399bb89..248528cc9c 100644
--- a/usr/src/cmd/eeprom/Makefile.com
+++ b/usr/src/cmd/eeprom/Makefile.com
@@ -37,6 +37,10 @@ DIRMODE = 755
OBJS = error.o
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
LINT_OBJS = $(OBJS:%.o=%.ln)
SOURCES = $(OBJS:%.o=%.c)
diff --git a/usr/src/cmd/egrep/Makefile b/usr/src/cmd/egrep/Makefile
index 3f2dc324c6..fde0fabcbe 100644
--- a/usr/src/cmd/egrep/Makefile
+++ b/usr/src/cmd/egrep/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -31,6 +29,10 @@ PROG= egrep
include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
.KEEP_STATE:
diff --git a/usr/src/cmd/eqn/eqn.d/Makefile b/usr/src/cmd/eqn/eqn.d/Makefile
index 597a9649da..8b9dfcf422 100644
--- a/usr/src/cmd/eqn/eqn.d/Makefile
+++ b/usr/src/cmd/eqn/eqn.d/Makefile
@@ -1,11 +1,7 @@
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/eqn/eqn.d/Makefile
-#
include ../../Makefile.cmd
@@ -35,6 +31,10 @@ YFLAGS = -d
CPPFLAGS = -I. -I.. $(CPPFLAGS.master)
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all : $(PROG)
diff --git a/usr/src/cmd/eqn/neqn.d/Makefile b/usr/src/cmd/eqn/neqn.d/Makefile
index 2eccf34578..2863de2874 100644
--- a/usr/src/cmd/eqn/neqn.d/Makefile
+++ b/usr/src/cmd/eqn/neqn.d/Makefile
@@ -1,11 +1,7 @@
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/eqn/neqn.d/Makefile
-#
include ../../Makefile.cmd
@@ -30,6 +26,10 @@ YFLAGS = -d
CPPFLAGS = -DNEQN -I. -I.. $(CPPFLAGS.master)
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+
#
# for message catalog
#
@@ -45,7 +45,7 @@ $(PROG) : $(OBJS) $(MAPFILE.NGB)
$(POST_PROCESS)
catalog: $(POFILE)
-
+
$(POFILE): $(POFILES)
$(RM) $@
cat $(POFILES) > $@
diff --git a/usr/src/cmd/expr/Makefile b/usr/src/cmd/expr/Makefile
index 8d8aeaa732..dbc390fce5 100644
--- a/usr/src/cmd/expr/Makefile
+++ b/usr/src/cmd/expr/Makefile
@@ -36,6 +36,8 @@ SRCS= expr.c compile.c
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-extra
$(XPG4) := CFLAGS += -DXPG4
$(XPG6) := CFLAGS += -DXPG6
diff --git a/usr/src/cmd/exstr/Makefile b/usr/src/cmd/exstr/Makefile
index 574a7e80a2..3123493743 100644
--- a/usr/src/cmd/exstr/Makefile
+++ b/usr/src/cmd/exstr/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,8 @@ PROG= exstr
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-extra
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/factor/Makefile b/usr/src/cmd/factor/Makefile
index 89d6691ab8..05bccd0c85 100644
--- a/usr/src/cmd/factor/Makefile
+++ b/usr/src/cmd/factor/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -30,6 +28,7 @@ PROG= factor
include ../Makefile.cmd
LDLIBS += -lm
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
.KEEP_STATE:
diff --git a/usr/src/cmd/fcinfo/Makefile b/usr/src/cmd/fcinfo/Makefile
index a824667d71..ebe3fc72cd 100644
--- a/usr/src/cmd/fcinfo/Makefile
+++ b/usr/src/cmd/fcinfo/Makefile
@@ -47,6 +47,8 @@ include ../Makefile.cmd
POFILE = fcinfo_cmd.po
POFILES = fcinfo.po fcinfo-list.po fcadm-list.po printAttrs.po fcoeadm.po
+CERRWARN += -_gcc=-Wno-unused-variable
+
ROOTMANIFESTDIR= $(ROOTSVCNETWORK)
LDLIBS += -lHBAAPI
diff --git a/usr/src/cmd/fdformat/Makefile b/usr/src/cmd/fdformat/Makefile
index 8a04df934e..13a5204cad 100644
--- a/usr/src/cmd/fdformat/Makefile
+++ b/usr/src/cmd/fdformat/Makefile
@@ -32,6 +32,8 @@ include ../Makefile.cmd
LDLIBS += -lvolmgt
LINTFLAGS += -um
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
#
diff --git a/usr/src/cmd/fgrep/Makefile b/usr/src/cmd/fgrep/Makefile
index a5ac396dcd..26d8ef046c 100644
--- a/usr/src/cmd/fgrep/Makefile
+++ b/usr/src/cmd/fgrep/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -31,7 +29,7 @@ PROG= fgrep
include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64
-
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/file/Makefile b/usr/src/cmd/file/Makefile
index e7e7f2b9b2..0c9f5dd3fd 100644
--- a/usr/src/cmd/file/Makefile
+++ b/usr/src/cmd/file/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= file
XPG4PROG= file
@@ -39,6 +37,9 @@ SRCS= file.c elf_read.c magicutils.c $(ELFCAP)/elfcap.c
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-type-limits
+
POFILE= file_all.po
POFILES= $(SRCS:%.c=%.po)
diff --git a/usr/src/cmd/file/elf_read.c b/usr/src/cmd/file/elf_read.c
index 5711ef3a63..7ccf8e2bb3 100644
--- a/usr/src/cmd/file/elf_read.c
+++ b/usr/src/cmd/file/elf_read.c
@@ -30,8 +30,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* ELF files can exceed 2GB in size. A standard 32-bit program
* like 'file' cannot read past 2GB, and will be unable to see
@@ -458,6 +456,8 @@ process_shdr(Elf_Info *EI)
cap_off = shdr->sh_offset;
if (shdr->sh_type == SHT_SUNW_cap) {
+ char capstr[128];
+
if (shdr->sh_size == 0 || shdr->sh_entsize == 0) {
(void) fprintf(stderr, ELF_ERR_ELFCAP1,
File, EI->file);
@@ -477,14 +477,28 @@ process_shdr(Elf_Info *EI)
return (ELF_READ_FAIL);
}
- if (Chdr.c_tag != CA_SUNW_NULL) {
- (void) elfcap_tag_to_str(
- ELFCAP_STYLE_UC, Chdr.c_tag,
- Chdr.c_un.c_val, EI->cap_str,
- sizeof (EI->cap_str),
- ELFCAP_FMT_SNGSPACE, mac);
- }
cap_off += csize;
+
+ /*
+ * Each capatibility group is terminated with
+ * CA_SUNW_NULL. Groups other than the first
+ * represent symbol capabilities, and aren't
+ * interesting here.
+ */
+ if (Chdr.c_tag == CA_SUNW_NULL)
+ break;
+
+ (void) elfcap_tag_to_str(ELFCAP_STYLE_UC,
+ Chdr.c_tag, Chdr.c_un.c_val, capstr,
+ sizeof (capstr), ELFCAP_FMT_SNGSPACE,
+ mac);
+
+ if ((*EI->cap_str != '\0') && (*capstr != '\0'))
+ (void) strlcat(EI->cap_str, " ",
+ sizeof (EI->cap_str));
+
+ (void) strlcat(EI->cap_str, capstr,
+ sizeof (EI->cap_str));
}
}
diff --git a/usr/src/cmd/filebench/Makefile.com b/usr/src/cmd/filebench/Makefile.com
index 5059a5e516..0f0a51c654 100644
--- a/usr/src/cmd/filebench/Makefile.com
+++ b/usr/src/cmd/filebench/Makefile.com
@@ -54,6 +54,13 @@ LINTFLAGS += -erroff=E_FUNC_ARG_UNUSED -erroff=E_NAME_DEF_NOT_USED2 \
-erroff=E_NAME_USED_NOT_DEF2 -erroff=E_INCONS_ARG_DECL2
LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED -erroff=E_NAME_DEF_NOT_USED2 \
-erroff=E_NAME_USED_NOT_DEF2 -erroff=E_INCONS_ARG_DECL2
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+
LINTFILES = $(SRCS:%.c=%.ln)
CLEANFILES += parser_gram.c parser_gram.h parser_lex.c y.tab.h y.tab.c
diff --git a/usr/src/cmd/filesync/Makefile b/usr/src/cmd/filesync/Makefile
index 2e8e0fbc36..23ab3239fe 100644
--- a/usr/src/cmd/filesync/Makefile
+++ b/usr/src/cmd/filesync/Makefile
@@ -32,6 +32,9 @@ include ../Makefile.cmd
LDLIBS += -lgen
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
FILEMODE= 0555
.KEEP_STATE:
diff --git a/usr/src/cmd/find/Makefile b/usr/src/cmd/find/Makefile
index dfdb210815..b7765acf17 100644
--- a/usr/src/cmd/find/Makefile
+++ b/usr/src/cmd/find/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -37,6 +35,10 @@ include ../Makefile.cmd
$(XPG4) := CFLAGS += -DXPG4
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += -u
LDLIBS += -lsec
diff --git a/usr/src/cmd/flowstat/Makefile b/usr/src/cmd/flowstat/Makefile
index 5cb3eb4025..7e0ee8bfb2 100644
--- a/usr/src/cmd/flowstat/Makefile
+++ b/usr/src/cmd/flowstat/Makefile
@@ -35,6 +35,9 @@ XGETFLAGS += -a -x $(PROG).xcl
LDLIBS += -L$(ROOT)/lib
LDLIBS += -ldladm -linetutil
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTCFGDIR= $(ROOTETC)/dladm
.KEEP_STATE:
diff --git a/usr/src/cmd/fm/eversholt/Makefile.esc.com b/usr/src/cmd/fm/eversholt/Makefile.esc.com
index 02cd6ed2b0..5d3c49703a 100644
--- a/usr/src/cmd/fm/eversholt/Makefile.esc.com
+++ b/usr/src/cmd/fm/eversholt/Makefile.esc.com
@@ -22,11 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# include makefile for eversholt common files
-#
-#
FMADIR = $(SRC)/cmd/fm
EVERDIR = $(FMADIR)/eversholt
@@ -48,7 +43,11 @@ LINTFLAGS = -mnux
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
CPPFLAGS += -I$(EVERCMNSRC) -I.
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
CTFCONVO = $(CTFCONVERT_O)
CTFMRG = $(CTFMERGE) -L VERSION -o $@ $(OBJS)
diff --git a/usr/src/cmd/fm/fmd/Makefile.fmd b/usr/src/cmd/fm/fmd/Makefile.fmd
index 4180d9c155..67182fa4d1 100644
--- a/usr/src/cmd/fm/fmd/Makefile.fmd
+++ b/usr/src/cmd/fm/fmd/Makefile.fmd
@@ -116,6 +116,11 @@ CPPFLAGS += -I. -I../common
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
LINTFLAGS += -mu
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-clobbered
$(PROG) := LDFLAGS += -R/usr/lib/fm
$(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo -ldiagcode -lsysevent -lsmbios \
diff --git a/usr/src/cmd/fm/fmdump/Makefile.com b/usr/src/cmd/fm/fmdump/Makefile.com
index 4a146eb124..fbd90d9ea1 100644
--- a/usr/src/cmd/fm/fmdump/Makefile.com
+++ b/usr/src/cmd/fm/fmdump/Makefile.com
@@ -38,6 +38,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lnvpair -ltopo -lfmd_msg
LDFLAGS += -R/usr/lib/fm
LINTFLAGS += -mnu
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.NO_PARALLEL:
.PARALLEL: $(OBJS) $(LINTFILES)
diff --git a/usr/src/cmd/fm/fminject/Makefile.com b/usr/src/cmd/fm/fminject/Makefile.com
index 32f33dfc81..c6b60be1cb 100644
--- a/usr/src/cmd/fm/fminject/Makefile.com
+++ b/usr/src/cmd/fm/fminject/Makefile.com
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
.SUFFIXES:
@@ -50,6 +49,11 @@ CLEANFILES += inj_grammar.c inj_grammar.h inj_lex.c y.tab.h y.tab.c
CPPFLAGS += -I. -I../common
CFLAGS += $(CCVERBOSE) $(CTF_FLAGS)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_log -lsysevent -lnvpair -lumem
LDFLAGS += -R/usr/lib/fm
LINTFLAGS = -mnux
diff --git a/usr/src/cmd/fm/ipmitopo/Makefile.com b/usr/src/cmd/fm/ipmitopo/Makefile.com
index 60439e5e75..003331dba6 100644
--- a/usr/src/cmd/fm/ipmitopo/Makefile.com
+++ b/usr/src/cmd/fm/ipmitopo/Makefile.com
@@ -41,6 +41,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
LDLIBS += -lipmi -lnvpair
LINTFLAGS += -mnu
+CERRWARN += -_gcc=-Wno-uninitialized
+
.NO_PARALLEL:
.PARALLEL: $(OBJS) $(LINTFILES)
diff --git a/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile b/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile
index c45119ca68..c9a3f21f3f 100644
--- a/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile
+++ b/usr/src/cmd/fm/modules/SUNW,SPARC-Enterprise/event-transport/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
PLATFORMS = SUNW,SPARC-Enterprise
@@ -34,3 +33,4 @@ XPORTLIBS = -lsocket -lnsl -ldscp
include ../../common/event-transport/Makefile.etm
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/fm/modules/common/disk-monitor/Makefile b/usr/src/cmd/fm/modules/common/disk-monitor/Makefile
index 252f0d3e4d..4ee7343d45 100644
--- a/usr/src/cmd/fm/modules/common/disk-monitor/Makefile
+++ b/usr/src/cmd/fm/modules/common/disk-monitor/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
MODULE = disk-monitor
CLASS = common
@@ -35,3 +34,4 @@ LINTFLAGS += -I. -I$(SRC)/lib/fm/topo/modules/common/disk -L$(ROOT)/usr/lib/fm
CFLAGS += -I. -I$(SRC)/lib/fm/topo/modules/common/disk
LDLIBS += -lsysevent -lnvpair -lsmbios -lcfgadm -ltopo -luutil -lipmi
LDFLAGS += -L$(ROOT)/usr/lib/fm -R/usr/lib/fm
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fm/modules/common/eversholt/Makefile b/usr/src/cmd/fm/modules/common/eversholt/Makefile
index 7e049fe437..c71726062e 100644
--- a/usr/src/cmd/fm/modules/common/eversholt/Makefile
+++ b/usr/src/cmd/fm/modules/common/eversholt/Makefile
@@ -22,7 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
#
# eft.so (the eversholt DE)
#
@@ -44,6 +43,11 @@ DMOD_SRCS = eft_mdb.c
include ../../Makefile.plugin
CPPFLAGS += -DFMAPLUGIN -I$(EVERSRCDIR) -I.
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
$(PROG) := LDFLAGS += -R/usr/lib/fm
$(PROG) := LDLIBS += -L$(ROOTLIB)/fm -ltopo
diff --git a/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile b/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile
index 5a53739a25..ef2fd7530d 100644
--- a/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile
+++ b/usr/src/cmd/fm/modules/common/fabric-xlate/Makefile
@@ -37,3 +37,7 @@ LINTFLAGS += -I$(INCDIRS)
LDFLAGS += -L$(ROOT)/usr/lib/fm -R/usr/lib/fm
LDLIBS += -luutil -lxml2 -L$(ROOTLIB)/fm -ltopo
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fm/modules/common/io-retire/Makefile b/usr/src/cmd/fm/modules/common/io-retire/Makefile
index 6ad3386fee..65fa4da1f4 100644
--- a/usr/src/cmd/fm/modules/common/io-retire/Makefile
+++ b/usr/src/cmd/fm/modules/common/io-retire/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
MODULE = io-retire
CLASS = common
@@ -31,3 +30,4 @@ SRCS = rio_main.c
include ../../Makefile.plugin
LDLIBS += -ldevinfo
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/fm/modules/common/ip-transport/Makefile b/usr/src/cmd/fm/modules/common/ip-transport/Makefile
index 39b9459e53..84f01180ab 100644
--- a/usr/src/cmd/fm/modules/common/ip-transport/Makefile
+++ b/usr/src/cmd/fm/modules/common/ip-transport/Makefile
@@ -24,7 +24,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ip-transport
CLASS = common
@@ -33,3 +32,4 @@ SRCS = ip.c
include ../../Makefile.plugin
LDLIBS += -lsocket -lnsl
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile b/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile
index 816132fe18..4317a71857 100644
--- a/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile
+++ b/usr/src/cmd/fm/modules/common/sw-diag-response/software-diagnosis/Makefile
@@ -49,3 +49,5 @@ CFLAGS += $(INCS)
LINTFLAGS += $(INCS)
LDLIBS += -L$(ROOTLIB)/fm -ltopo -luutil -luuid -lkstat
LDFLAGS += -R/usr/lib/fm
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile
index 851f541ee7..f54dc1ada9 100644
--- a/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile
+++ b/usr/src/cmd/fm/modules/sun4u/cpumem-diagnosis/Makefile
@@ -22,7 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#pragma ident "%Z%%M% %I% %E% SMI"
ARCH = sun4u
@@ -43,3 +42,7 @@ INCDIRS += $(SRC)/lib/fm/libfmd_adm/sparcv9
include ../../sun4/cpumem-diagnosis/Makefile.cpumem
LDLIBS += -L$(ROOT)/usr/lib/fm -lfmd_adm
LDFLAGS += -R/usr/lib/fm
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-char-subscripts
diff --git a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile
index f7ee88f4db..a44e656a47 100644
--- a/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile
+++ b/usr/src/cmd/fm/modules/sun4v/cpumem-diagnosis/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
ARCH = sun4v
@@ -36,3 +35,6 @@ include ../../sun4/cpumem-diagnosis/Makefile.cpumem
LDLIBS += -L$(ROOTLIB)/fm -lmdesc -lldom
LDFLAGS += -R/usr/lib/fm
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/fm/modules/sun4v/etm/Makefile b/usr/src/cmd/fm/modules/sun4v/etm/Makefile
index d4d21abf5e..2ea2e79af5 100644
--- a/usr/src/cmd/fm/modules/sun4v/etm/Makefile
+++ b/usr/src/cmd/fm/modules/sun4v/etm/Makefile
@@ -38,3 +38,7 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lldom -ltopo
LDFLAGS += -R/usr/lib/fm
DYNFLAGS += -R/usr/lib
+
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile b/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile
index 010344c850..21e2c40b62 100644
--- a/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile
+++ b/usr/src/cmd/fm/modules/sun4v/generic-mem/Makefile
@@ -52,6 +52,8 @@ GMEM_VERSION = "1.0"
LDLIBS += -L$(ROOTLIB)/fm -ltopo
LDFLAGS += -R/usr/lib/fm
CPPFLAGS += $(INCDIRS:%=-I%) -DGMEM_VERSION='$(GMEM_VERSION)' -D$(ARCH)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
%.o: $(GENERIC_MEM)/%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/cmd/fm/notify/smtp-notify/Makefile.com b/usr/src/cmd/fm/notify/smtp-notify/Makefile.com
index d969986fb4..d8861ea62b 100644
--- a/usr/src/cmd/fm/notify/smtp-notify/Makefile.com
+++ b/usr/src/cmd/fm/notify/smtp-notify/Makefile.com
@@ -52,6 +52,8 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \
LDFLAGS += -R/usr/lib/fm
LINTFLAGS += -mnu
+CERRWARN += -_gcc=-Wno-parentheses
+
.NO_PARALLEL:
.PARALLEL: $(OBJS) $(LINTFILES)
diff --git a/usr/src/cmd/fm/notify/snmp-notify/Makefile.com b/usr/src/cmd/fm/notify/snmp-notify/Makefile.com
index ff6b3b5a38..13c78c7ea2 100644
--- a/usr/src/cmd/fm/notify/snmp-notify/Makefile.com
+++ b/usr/src/cmd/fm/notify/snmp-notify/Makefile.com
@@ -50,6 +50,8 @@ LDLIBS += -L$(ROOT)/usr/lib/fm -lnvpair -lfmevent -lfmd_msg -lfmnotify \
LDFLAGS += -R/usr/lib/fm
LINTFLAGS += -mnu
+CERRWARN += -_gcc=-Wno-parentheses
+
.NO_PARALLEL:
.PARALLEL: $(OBJS) $(LINTFILES)
diff --git a/usr/src/cmd/fm/schemes/cpu/amd64/Makefile b/usr/src/cmd/fm/schemes/cpu/amd64/Makefile
index 257526a284..6f3caca2f4 100644
--- a/usr/src/cmd/fm/schemes/cpu/amd64/Makefile
+++ b/usr/src/cmd/fm/schemes/cpu/amd64/Makefile
@@ -23,8 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../../Makefile.com
include $(SRC)/Makefile.master.64
@@ -34,6 +32,7 @@ LDFLAGS += -lkstat \
-L$(ROOTLIB)/fm/$(MACH64) -ltopo
LDFLAGS += -R/usr/lib/fm/$(MACH64)
+CERRWARN += -_gcc=-Wno-parentheses
include ../../Makefile.targ
diff --git a/usr/src/cmd/fm/schemes/cpu/i386/Makefile b/usr/src/cmd/fm/schemes/cpu/i386/Makefile
index 59a8be49ae..28e1415bf3 100644
--- a/usr/src/cmd/fm/schemes/cpu/i386/Makefile
+++ b/usr/src/cmd/fm/schemes/cpu/i386/Makefile
@@ -23,8 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../../Makefile.com
@@ -33,6 +31,8 @@ LDLIBS += -lkstat \
-L$(ROOTLIB)/fm -ltopo
LDFLAGS += -R/usr/lib/fm
+CERRWARN += -_gcc=-Wno-parentheses
+
include ../../Makefile.targ
install: all $(ROOTPROG)
diff --git a/usr/src/cmd/fm/schemes/cpu/sparc/Makefile b/usr/src/cmd/fm/schemes/cpu/sparc/Makefile
index faa1f86434..35d2336a56 100644
--- a/usr/src/cmd/fm/schemes/cpu/sparc/Makefile
+++ b/usr/src/cmd/fm/schemes/cpu/sparc/Makefile
@@ -23,8 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../../Makefile.com
@@ -34,6 +32,8 @@ LDLIBS += -lkstat \
-L$(ROOTLIB)/fm -ltopo
LDFLAGS += -R/usr/lib/fm
+CERRWARN += -_gcc=-Wno-parentheses
+
include ../../Makefile.targ
install: all $(ROOTPROG)
diff --git a/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile b/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile
index cfb2d7dc5e..321e124237 100644
--- a/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile
+++ b/usr/src/cmd/fm/schemes/cpu/sparcv9/Makefile
@@ -23,8 +23,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
include ../../Makefile.com
include $(SRC)/Makefile.master.64
@@ -34,6 +32,8 @@ LDLIBS += -lkstat \
-L$(ROOTLIB)/fm/$(MACH64) -ltopo
LDFLAGS += -R/usr/lib/fm/$(MACH64)
+CERRWARN += -_gcc=-Wno-parentheses
+
include ../../Makefile.targ
install: all $(ROOTPROG64)
diff --git a/usr/src/cmd/fmt/Makefile b/usr/src/cmd/fmt/Makefile
index b94afa3821..21938536d6 100644
--- a/usr/src/cmd/fmt/Makefile
+++ b/usr/src/cmd/fmt/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -35,6 +33,9 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/fmtmsg/Makefile b/usr/src/cmd/fmtmsg/Makefile
index c99807ce23..c5ae7e2c1f 100644
--- a/usr/src/cmd/fmtmsg/Makefile
+++ b/usr/src/cmd/fmtmsg/Makefile
@@ -19,20 +19,19 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-
PROG= fmtmsg
OBJS= main.o
SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/format/Makefile b/usr/src/cmd/format/Makefile
index f96a6bb61e..f04050cd7c 100644
--- a/usr/src/cmd/format/Makefile
+++ b/usr/src/cmd/format/Makefile
@@ -44,6 +44,11 @@ DATA= format.dat
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-clobbered
+
SRCS= $(OBJS:.o=.c)
ROOTSYMLINK= $(ROOTETCPROG)
diff --git a/usr/src/cmd/fruadm/Makefile b/usr/src/cmd/fruadm/Makefile
index ed48cfc06b..8150fdea6c 100644
--- a/usr/src/cmd/fruadm/Makefile
+++ b/usr/src/cmd/fruadm/Makefile
@@ -33,6 +33,7 @@ include $(SRC)/Makefile.psm
FRULIBS = -L$(SRC)/lib/libfru/$(MACH) -lfru
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
CPPFLAGS += -I$(SRC)/lib/libfru/include
LINTFLAGS += -u
LDLIBS += $(FRULIBS) -lm
diff --git a/usr/src/cmd/fs.d/Makefile b/usr/src/cmd/fs.d/Makefile
index b8491f1a26..a34d351e8c 100644
--- a/usr/src/cmd/fs.d/Makefile
+++ b/usr/src/cmd/fs.d/Makefile
@@ -78,6 +78,13 @@ SYMUSRBIN2USRSBIN= $(USRBIN2USRSBIN:%=$(ROOTBIN)/%)
SYMDEVNM= $(ROOTUSRSBIN)/devnm
CPPFLAGS += -D_LARGEFILE64_SOURCE
+
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
%.xpg4.o := CPPFLAGS += -DXPG4
$(SPPROG) := LDLIBS += -lkstat
diff --git a/usr/src/cmd/fs.d/autofs/Makefile b/usr/src/cmd/fs.d/autofs/Makefile
index c3193c3089..4326e1c1a3 100644
--- a/usr/src/cmd/fs.d/autofs/Makefile
+++ b/usr/src/cmd/fs.d/autofs/Makefile
@@ -88,6 +88,14 @@ $(TYPEPROG) := LDLIBS += -lrpcsvc -lsocket -lnsl -lsldap -lkstat -lscf
CFLAGS += $(CCVERBOSE) -D_FILE_OFFSET_BITS=64
CPPFLAGS= -I. -I.. -I../nfs/lib $(CPPFLAGS.master) -D_REENTRANT \
$(MALLOC_DEBUG)
+
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+
OBJS= $(AUTOOBJS) $(MOUNTOBJS) $(TYPEOBJS) \
$(SHAREOBJS) $(UNSHAREOBJS)
diff --git a/usr/src/cmd/fs.d/cachefs/Makefile.cachefs b/usr/src/cmd/fs.d/cachefs/Makefile.cachefs
index d7eb1363eb..4b7bc57fb3 100644
--- a/usr/src/cmd/fs.d/cachefs/Makefile.cachefs
+++ b/usr/src/cmd/fs.d/cachefs/Makefile.cachefs
@@ -20,10 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,2001 by Sun Microsystems, Inc.
# All rights reserved.
+#
CACHEFSDIR= $(SRC)/cmd/fs.d/$(FSTYPE)/common
@@ -52,6 +51,12 @@ CFSLIB= $(CACHEFSDIR)/$(LIBRARY)
CFSLIBMT= $(CACHEFSDIR)/$(LIBRARYMT)
LDLIBS += $(CFSLIB)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/dev/Makefile b/usr/src/cmd/fs.d/dev/Makefile
index 8da5c545a1..db59d04876 100644
--- a/usr/src/cmd/fs.d/dev/Makefile
+++ b/usr/src/cmd/fs.d/dev/Makefile
@@ -21,8 +21,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYPE= dev
PROG= mount
@@ -38,3 +36,5 @@ $(ROOTLIBFSTYPE)/%: $(ROOTLIBFSTYPE) %
include ../Makefile.fstype
include ../Makefile.mount
include ../Makefile.mount.targ
+
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/fs.d/hsfs/fstyp/Makefile b/usr/src/cmd/fs.d/hsfs/fstyp/Makefile
index 85a26afd04..507915db15 100644
--- a/usr/src/cmd/fs.d/hsfs/fstyp/Makefile
+++ b/usr/src/cmd/fs.d/hsfs/fstyp/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYP_VERS=1
FSTYPE= hsfs
@@ -62,6 +60,8 @@ SRCS= ${LIBPROG:%.so.$(FSTYP_VERS)=%.c}
CPPFLAGS += -DFSTYP_VERS=${FSTYP_VERS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-switch
+
.KEEP_STATE:
all: $(LIBPROG)
diff --git a/usr/src/cmd/fs.d/hsfs/labelit/Makefile b/usr/src/cmd/fs.d/hsfs/labelit/Makefile
index 0dbe28c9df..fdf2c43912 100644
--- a/usr/src/cmd/fs.d/hsfs/labelit/Makefile
+++ b/usr/src/cmd/fs.d/hsfs/labelit/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -31,6 +29,10 @@ ATTMK= $(LIBPROG)
include ../../Makefile.fstype
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+
lint := PROG = $(LIBPROG)
lint: lint_PROG
diff --git a/usr/src/cmd/fs.d/hsfs/mount/Makefile b/usr/src/cmd/fs.d/hsfs/mount/Makefile
index 50a6f3b30e..9afcfc72f1 100644
--- a/usr/src/cmd/fs.d/hsfs/mount/Makefile
+++ b/usr/src/cmd/fs.d/hsfs/mount/Makefile
@@ -23,8 +23,6 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYPE= hsfs
LIBPROG= mount
@@ -40,3 +38,5 @@ $(ROOTLIBFSTYPE)/%: $(ROOTLIBFSTYPE) %
include ../../Makefile.fstype
include ../../Makefile.mount
include ../../Makefile.mount.targ
+
+CERRWARN += -_gcc=-Wno-unused-variable
diff --git a/usr/src/cmd/fs.d/nfs/dfmounts/Makefile b/usr/src/cmd/fs.d/nfs/dfmounts/Makefile
index c287ccf025..bd6ae76dd7 100644
--- a/usr/src/cmd/fs.d/nfs/dfmounts/Makefile
+++ b/usr/src/cmd/fs.d/nfs/dfmounts/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -42,6 +40,9 @@ POFILE= dfmounts.po
LDLIBS += -lrpcsvc -lnsl
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/nfs/dfshares/Makefile b/usr/src/cmd/fs.d/nfs/dfshares/Makefile
index 7c2bc29ce4..ffda5d11cb 100644
--- a/usr/src/cmd/fs.d/nfs/dfshares/Makefile
+++ b/usr/src/cmd/fs.d/nfs/dfshares/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.12 */
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -35,6 +33,9 @@ OBJS= $(LIBPROG).o
SRCS= $(OBJS:%.o=%.c)
LDLIBS += -lrpcsvc -lnsl
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
diff --git a/usr/src/cmd/fs.d/nfs/mount/Makefile b/usr/src/cmd/fs.d/nfs/mount/Makefile
index 4c6fb4686a..dd28ff761d 100644
--- a/usr/src/cmd/fs.d/nfs/mount/Makefile
+++ b/usr/src/cmd/fs.d/nfs/mount/Makefile
@@ -42,6 +42,13 @@ SRCS= $(LIBPROG).c $(FSLIBSRC) ../lib/nfs_sec.c ../lib/replica.c \
UNCHECKED_HDRS= webnfs.h
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
+
#
# Message catalog
#
diff --git a/usr/src/cmd/fs.d/nfs/mountd/Makefile b/usr/src/cmd/fs.d/nfs/mountd/Makefile
index b4271cc5f3..f71a8b4816 100644
--- a/usr/src/cmd/fs.d/nfs/mountd/Makefile
+++ b/usr/src/cmd/fs.d/nfs/mountd/Makefile
@@ -39,6 +39,15 @@ DOBJ = $(DSRC:%.d=%.o)
LDLIBS += -lrpcsvc -lnsl -lbsm -lsocket -ltsnet -ltsol -lnvpair -lscf
CPPFLAGS += -D_REENTRANT -I../lib
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
+
$(TYPEPROG): $(OBJS)
$(COMPILE.d) -s $(DSRC) -o $(DOBJ) $(OBJS)
$(LINK.c) -o $@ $(DOBJ) $(OBJS) $(LDLIBS)
diff --git a/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile b/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile
index 96921e3359..4c6f4dca16 100644
--- a/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfs4cbd/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/fs.d/nfs/nfs4cbd/Makefile
FSTYPE= nfs
TYPEPROG= nfs4cbd
@@ -39,6 +36,10 @@ LDLIBS += -lnsl
CPPFLAGS += -I. -I../.. -I../lib
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-extra
+
.KEEP_STATE:
all: $(TYPEPROG)
diff --git a/usr/src/cmd/fs.d/nfs/nfsd/Makefile b/usr/src/cmd/fs.d/nfs/nfsd/Makefile
index 14cc63869b..90a77dcbef 100644
--- a/usr/src/cmd/fs.d/nfs/nfsd/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfsd/Makefile
@@ -37,7 +37,10 @@ SRCS= $(LOCAL:%.o=%.c) ../lib/nfs_tbind.c ../lib/thrpool.c ../lib/daemon.c \
../lib/smfcfg.c
CPPFLAGS += -I../lib
-
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-extra
$(TYPEPROG): $(OBJS)
$(CC) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
diff --git a/usr/src/cmd/fs.d/nfs/nfslog/Makefile b/usr/src/cmd/fs.d/nfs/nfslog/Makefile
index c8d5ec9127..243574f744 100644
--- a/usr/src/cmd/fs.d/nfs/nfslog/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfslog/Makefile
@@ -22,9 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/fs.d/nfs/nfslog/Makefile
FSTYPE= nfs
TYPEPROG= nfslogd
@@ -41,6 +38,10 @@ OBJS= $(LOCAL) $(COMMON)
SRCS= $(LOCAL:%.o=%.c) $(COMMON:%.o=../lib/%.c)
LDLIBS += -lsocket -lnsl
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-type-limits
CPPFLAGS += -D_FILE_OFFSET_BITS=64
#
diff --git a/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile b/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile
index 7d29271eb0..6afd2bb495 100644
--- a/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfsmapid/Makefile
@@ -39,6 +39,10 @@ DOBJ = $(DSRC:%.d=%.o)
OBJS = nfsmapid.o nfsmapid_server.o $(COMMON)
CPPFLAGS += -I../lib -D_POSIX_PTHREAD_SEMANTICS
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
all: $(TYPEPROG) $(TESTPROG)
diff --git a/usr/src/cmd/fs.d/nfs/nfsref/Makefile b/usr/src/cmd/fs.d/nfs/nfsref/Makefile
index fa5d58460d..9f5b8e73a3 100644
--- a/usr/src/cmd/fs.d/nfs/nfsref/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfsref/Makefile
@@ -34,6 +34,8 @@ CFLAGS += $(CCVERBOSE) -I../lib
OBJS= nfsref.o ref_subr.o
SRCS= nfsref.c
+CERRWARN += -_gcc=-Wno-unused-variable
+
LDLIBS += -lreparse -lnvpair -lnsl -lumem
$(PROG): $(OBJS)
diff --git a/usr/src/cmd/fs.d/nfs/nfsstat/Makefile b/usr/src/cmd/fs.d/nfs/nfsstat/Makefile
index a5000c80c8..1fe48838f6 100644
--- a/usr/src/cmd/fs.d/nfs/nfsstat/Makefile
+++ b/usr/src/cmd/fs.d/nfs/nfsstat/Makefile
@@ -41,6 +41,7 @@ SRCS += $(STAT_COMMON_SRCS)
OBJS += $(STAT_COMMON_OBJS)
CPPFLAGS += -I$(STATCOMMONDIR)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lkstat -lnsl
$(PROG): $(OBJS)
diff --git a/usr/src/cmd/fs.d/nfs/rquotad/Makefile b/usr/src/cmd/fs.d/nfs/rquotad/Makefile
index aa6f6965d4..e75afe3a9b 100644
--- a/usr/src/cmd/fs.d/nfs/rquotad/Makefile
+++ b/usr/src/cmd/fs.d/nfs/rquotad/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -36,6 +34,8 @@ SRCS= $(OBJS:%.o=%.c)
XFILE= $(ROOT)/usr/include/rpcsvc/rquota.x
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
LDLIBS += -lnsl
$(TYPEPROG): $(OBJS)
diff --git a/usr/src/cmd/fs.d/nfs/showmount/Makefile b/usr/src/cmd/fs.d/nfs/showmount/Makefile
index 2400dc8c18..7974fd5cdc 100644
--- a/usr/src/cmd/fs.d/nfs/showmount/Makefile
+++ b/usr/src/cmd/fs.d/nfs/showmount/Makefile
@@ -20,11 +20,8 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI" /* */
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/fs.d/nfs/showmount/Makefile
FSTYPE= nfs
LIBPROG= showmount
@@ -45,6 +42,11 @@ POFILE= showmount.po
LDLIBS += -lrpcsvc -lnsl
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/nfs/statd/Makefile b/usr/src/cmd/fs.d/nfs/statd/Makefile
index 709454b57a..1e55770f83 100644
--- a/usr/src/cmd/fs.d/nfs/statd/Makefile
+++ b/usr/src/cmd/fs.d/nfs/statd/Makefile
@@ -23,10 +23,6 @@
# Copyright 1990-2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/fs.d/nfs/statd/Makefile
-#
FSTYPE= nfs
TYPEPROG= statd
@@ -35,6 +31,10 @@ ATTMK= $(TYPEPROG)
include ../../Makefile.fstype
CPPFLAGS += -D_REENTRANT -DSUN_THREADS
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
OBJS= sm_svc.o sm_proc.o sm_statd.o selfcheck.o
SRCS= sm_svc.c sm_proc.c sm_statd.c ../lib/selfcheck.c
diff --git a/usr/src/cmd/fs.d/pcfs/fsck/Makefile b/usr/src/cmd/fs.d/pcfs/fsck/Makefile
index deecc57ceb..dbe2df4a98 100644
--- a/usr/src/cmd/fs.d/pcfs/fsck/Makefile
+++ b/usr/src/cmd/fs.d/pcfs/fsck/Makefile
@@ -19,12 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/fs.d/pcfs/fsck/Makefile
FSTYPE= pcfs
LIBPROG= fsck
@@ -58,6 +55,10 @@ catalog: $(POFILE)
#
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# We need to tell lint not to complain about the routines
# we are grabbing from the kernel as being undefined.
diff --git a/usr/src/cmd/fs.d/pcfs/mkfs/Makefile b/usr/src/cmd/fs.d/pcfs/mkfs/Makefile
index 4edca7e6fc..6a3a05acf9 100644
--- a/usr/src/cmd/fs.d/pcfs/mkfs/Makefile
+++ b/usr/src/cmd/fs.d/pcfs/mkfs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1998 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -42,6 +40,7 @@ POFILE= mkfs.po
catalog: $(POFILE)
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-parentheses
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
diff --git a/usr/src/cmd/fs.d/pcfs/mount/Makefile b/usr/src/cmd/fs.d/pcfs/mount/Makefile
index 2da6037e9c..bb29ed53d8 100644
--- a/usr/src/cmd/fs.d/pcfs/mount/Makefile
+++ b/usr/src/cmd/fs.d/pcfs/mount/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,3 +30,5 @@ LIBPROG= mount
include ../../Makefile.fstype
include ../../Makefile.mount
include ../../Makefile.mount.targ
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fs.d/reparsed/Makefile b/usr/src/cmd/fs.d/reparsed/Makefile
index 9df265a3c9..e61d7140f4 100644
--- a/usr/src/cmd/fs.d/reparsed/Makefile
+++ b/usr/src/cmd/fs.d/reparsed/Makefile
@@ -37,6 +37,7 @@ POFILE= $(TYPEPROG).po
CLOBBERFILES += $(TYPEPROG)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
C99MODE= $(C99_ENABLE)
LDLIBS += -lreparse -lnsl
diff --git a/usr/src/cmd/fs.d/smbclnt/chacl/Makefile b/usr/src/cmd/fs.d/smbclnt/chacl/Makefile
index a791c7b07a..52a9d04112 100644
--- a/usr/src/cmd/fs.d/smbclnt/chacl/Makefile
+++ b/usr/src/cmd/fs.d/smbclnt/chacl/Makefile
@@ -35,6 +35,8 @@ SRCS= $(LIBPROG).c $(FSLIBSRC)
LDLIBS += -lsmbfs -lsec
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
C99MODE= $(C99_ENABLE)
CLOBBERFILES += $(LIBPROG)
diff --git a/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile b/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile
index 4fbb347a73..fad9235ecd 100644
--- a/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile
+++ b/usr/src/cmd/fs.d/smbclnt/lsacl/Makefile
@@ -35,6 +35,7 @@ SRCS= $(LIBPROG).c $(FSLIBSRC)
LDLIBS += -lsmbfs -lsec
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-label
C99MODE= $(C99_ENABLE)
CLOBBERFILES += $(LIBPROG)
diff --git a/usr/src/cmd/fs.d/smbclnt/mount/Makefile b/usr/src/cmd/fs.d/smbclnt/mount/Makefile
index 7dc0011dd3..0124840e23 100644
--- a/usr/src/cmd/fs.d/smbclnt/mount/Makefile
+++ b/usr/src/cmd/fs.d/smbclnt/mount/Makefile
@@ -41,6 +41,8 @@ CLOBBERFILES += $(LIBPROG)
$(ROOTLIBFSTYPE)/mount := FILEMODE= 04555
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
C99MODE= $(C99_ENABLE)
LDLIBS += -lsmbfs
diff --git a/usr/src/cmd/fs.d/smbclnt/test/Makefile b/usr/src/cmd/fs.d/smbclnt/test/Makefile
index 09e2ebdda9..40f12dfc39 100644
--- a/usr/src/cmd/fs.d/smbclnt/test/Makefile
+++ b/usr/src/cmd/fs.d/smbclnt/test/Makefile
@@ -36,6 +36,7 @@ SRCS= $(LIBPROG).c $(FSLIBSRC)
LDLIBS += -lsmbfs
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
C99MODE= $(C99_ENABLE)
CLOBBERFILES += $(LIBPROG)
diff --git a/usr/src/cmd/fs.d/tmpfs/Makefile b/usr/src/cmd/fs.d/tmpfs/Makefile
index 6e6f0de398..61599e70f4 100644
--- a/usr/src/cmd/fs.d/tmpfs/Makefile
+++ b/usr/src/cmd/fs.d/tmpfs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,3 +30,5 @@ LIBPROG= mount
include ../Makefile.fstype
include ../Makefile.mount
include ../Makefile.mount.targ
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/fs.d/udfs/fsck/Makefile b/usr/src/cmd/fs.d/udfs/fsck/Makefile
index e76104ddc7..f3870fba38 100644
--- a/usr/src/cmd/fs.d/udfs/fsck/Makefile
+++ b/usr/src/cmd/fs.d/udfs/fsck/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -39,6 +37,9 @@ UDFSDIR= ../mkfs
UDFSOBJS= udfslib.o
#UDFSSRCS= $(UDFSOBJS:%.o=%.c)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
OBJS= $(FSCKOBJS) $(UDFSOBJS)
SRCS= $(FSCKSRCS) $(UDFSSRCS) ../mkfs/udfslib.c
diff --git a/usr/src/cmd/fs.d/udfs/fsdb/Makefile b/usr/src/cmd/fs.d/udfs/fsdb/Makefile
index ebfb304eb9..4da2706c79 100644
--- a/usr/src/cmd/fs.d/udfs/fsdb/Makefile
+++ b/usr/src/cmd/fs.d/udfs/fsdb/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -44,6 +42,13 @@ YFLAGS = "-d"
LINTFLAGS += -erroff=E_STATIC_UNUSED
LINTFLAGS64 += -erroff=E_STATIC_UNUSED
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-unused-function
+
SRCS= fsdb.c ud_lib.c
fsdb : fsdb_yacc.o fsdb_lex.o ud_lib.o fsdb.o $(MAPFILES)
diff --git a/usr/src/cmd/fs.d/udfs/fstyp/Makefile b/usr/src/cmd/fs.d/udfs/fstyp/Makefile
index 55164e69cb..454d7f43c1 100644
--- a/usr/src/cmd/fs.d/udfs/fstyp/Makefile
+++ b/usr/src/cmd/fs.d/udfs/fstyp/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYP_VERS=1
FSTYPE= udfs
@@ -38,6 +36,9 @@ MAPFILES =
CFLAGS += $(C_PICFLAGS)
DYNLIB= $(LIBPROG)
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lnvpair -ladm -lc
LINTFLAGS += -erroff=E_STATIC_UNUSED -erroff=E_NAME_DEF_NOT_USED2
diff --git a/usr/src/cmd/fs.d/udfs/labelit/Makefile b/usr/src/cmd/fs.d/udfs/labelit/Makefile
index 6d058fab42..e0bfc31b25 100644
--- a/usr/src/cmd/fs.d/udfs/labelit/Makefile
+++ b/usr/src/cmd/fs.d/udfs/labelit/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#pragma ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -38,6 +36,9 @@ CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LINTFLAGS += -xerroff=E_STATIC_UNUSED
LINTFLAGS64 += -xerroff=E_STATIC_UNUSED
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+
labelit : labelit.o ud_lib.o
$(LINK.c) -o $@ labelit.o ud_lib.o $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/udfs/mkfs/Makefile b/usr/src/cmd/fs.d/udfs/mkfs/Makefile
index 753b5a2a55..e235f01963 100644
--- a/usr/src/cmd/fs.d/udfs/mkfs/Makefile
+++ b/usr/src/cmd/fs.d/udfs/mkfs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1999,2001 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -47,6 +45,9 @@ UDFSDIR= ../../../../uts/common/fs/ufs
#UDFSOBJS= ufs_subr.o ufs_tables.o
UDFSOBJS=
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
OBJS= $(MKFSOBJS) $(UDFSOBJS)
SRCS= $(OBJS:%.o=%.c)
diff --git a/usr/src/cmd/fs.d/ufs/df/Makefile b/usr/src/cmd/fs.d/ufs/df/Makefile
index 548ea3ea95..5b579980b9 100644
--- a/usr/src/cmd/fs.d/ufs/df/Makefile
+++ b/usr/src/cmd/fs.d/ufs/df/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYPE= ufs
LIBPROG= df
@@ -37,6 +35,11 @@ OBJS= df.o
CPPFLAGS += -D_LARGEFILE64_SOURCE
LDLIBS += -ladm
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+
# for messaging catalogue file
#
POFILE= df.po
diff --git a/usr/src/cmd/fs.d/ufs/edquota/Makefile b/usr/src/cmd/fs.d/ufs/edquota/Makefile
index 103bcace92..1f29704147 100644
--- a/usr/src/cmd/fs.d/ufs/edquota/Makefile
+++ b/usr/src/cmd/fs.d/ufs/edquota/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/fs.d/ufs/edquota/Makefile
FSTYPE= ufs
LIBPROG= edquota
@@ -37,6 +34,7 @@ LINKVALUE= ../lib/fs/$(FSTYPE)/$(LIBPROG)
include ../../Makefile.fstype
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-parentheses
lint: lint_PROG
$(ROOTUSRSBIN)/$(LIBPROG):
diff --git a/usr/src/cmd/fs.d/ufs/ff/Makefile b/usr/src/cmd/fs.d/ufs/ff/Makefile
index 5425b7c5cd..2c12941ec9 100644
--- a/usr/src/cmd/fs.d/ufs/ff/Makefile
+++ b/usr/src/cmd/fs.d/ufs/ff/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -38,6 +36,8 @@ SRCS= $(LIBPROG).c $(ROLLSRCS)
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/ufs/fsck/Makefile b/usr/src/cmd/fs.d/ufs/fsck/Makefile
index 33200494df..9562fdedb2 100644
--- a/usr/src/cmd/fs.d/ufs/fsck/Makefile
+++ b/usr/src/cmd/fs.d/ufs/fsck/Makefile
@@ -19,12 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/fs.d/ufs/fsck/Makefile
FSTYPE= ufs
LIBPROG= fsck
@@ -50,6 +47,10 @@ SRCS= $(FSCKSRCS) $(UFSSRCS) $(ROLLSRCS) $(FSLIBSRC)
CPPFLAGS += -D_LARGEFILE64_SOURCE -I../../ -I../../../../lib/libadm/inc
LDLIBS += -lefi -lavl
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(LIBPROG): $(OBJS)
$(LINK.c) -o $@ $(OBJS) $(LDLIBS) $(CTFMERGE_HOOK)
$(POST_PROCESS)
diff --git a/usr/src/cmd/fs.d/ufs/fsdb/Makefile b/usr/src/cmd/fs.d/ufs/fsdb/Makefile
index 6ab2866e98..05dfa205dd 100644
--- a/usr/src/cmd/fs.d/ufs/fsdb/Makefile
+++ b/usr/src/cmd/fs.d/ufs/fsdb/Makefile
@@ -20,10 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,2001 by Sun Microsystems, Inc.
# All rights reserved.
+#
FSTYPE= ufs
LIBPROG= fsdb
@@ -32,6 +31,12 @@ include ../../Makefile.fstype
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
SRCS= $(LIBPROG).c
lint: lint_SRCS
diff --git a/usr/src/cmd/fs.d/ufs/fssnap/Makefile b/usr/src/cmd/fs.d/ufs/fssnap/Makefile
index 50c73e5bb1..155ad227e8 100644
--- a/usr/src/cmd/fs.d/ufs/fssnap/Makefile
+++ b/usr/src/cmd/fs.d/ufs/fssnap/Makefile
@@ -23,8 +23,6 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
FSTYPE= ufs
LIBPROG= fssnap
@@ -41,6 +39,10 @@ OBJS= $(FSSNAPOBJS) $(TOPOBJS)
SRCS= $(FSSNAPSRCS) $(TOPSRCS)
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lkstat -ldevinfo
# message catalog
diff --git a/usr/src/cmd/fs.d/ufs/mkfs/Makefile b/usr/src/cmd/fs.d/ufs/mkfs/Makefile
index a14f423d07..6b10524058 100644
--- a/usr/src/cmd/fs.d/ufs/mkfs/Makefile
+++ b/usr/src/cmd/fs.d/ufs/mkfs/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -36,6 +34,11 @@ OBJS= $(LIBPROG).o $(ROLLOBJS) $(FSLIB)
SRCS= $(LIBPROG).c $(ROLLSRCS) $(FSLIBSRC)
MKFSOBJS= mkfs.o
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-empty-body
+CERRWARN += -_gcc=-Wno-uninitialized
+
# for messaging catalog
#
POFILE= mkfs.po
diff --git a/usr/src/cmd/fs.d/ufs/mount/Makefile b/usr/src/cmd/fs.d/ufs/mount/Makefile
index abe90d6f68..1e7fca4a4e 100644
--- a/usr/src/cmd/fs.d/ufs/mount/Makefile
+++ b/usr/src/cmd/fs.d/ufs/mount/Makefile
@@ -22,9 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/fs.d/ufs/mount/Makefile
FSTYPE= ufs
PROG= mount
@@ -41,5 +38,6 @@ include ../../Makefile.fstype
include ../../Makefile.mount
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-parentheses
include ../../Makefile.mount.targ
diff --git a/usr/src/cmd/fs.d/ufs/newfs/Makefile b/usr/src/cmd/fs.d/ufs/newfs/Makefile
index 583ff1f97d..e740669879 100644
--- a/usr/src/cmd/fs.d/ufs/newfs/Makefile
+++ b/usr/src/cmd/fs.d/ufs/newfs/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/fs.d/ufs/newfs/Makefile
FSTYPE= ufs
LIBPROG= newfs
@@ -38,6 +35,9 @@ include ../../Makefile.fstype
CPPFLAGS += -I../../ -D_LARGEFILE64_SOURCE
LDLIBS += -ladm -lefi
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
OBJS= $(LIBPROG).o $(FSLIB)
SRCS= $(LIBPROG).c $(FSLIBSRC)
diff --git a/usr/src/cmd/fs.d/ufs/quota/Makefile b/usr/src/cmd/fs.d/ufs/quota/Makefile
index 3f0fb8544c..3c2b6bc313 100644
--- a/usr/src/cmd/fs.d/ufs/quota/Makefile
+++ b/usr/src/cmd/fs.d/ufs/quota/Makefile
@@ -39,6 +39,10 @@ XFILE= $(ROOT)/usr/include/rpcsvc/rquota.x
CPPFLAGS += -I $(ROOT)/usr/include/sys -D_LARGEFILE64_SOURCE
LDLIBS += -lnsl
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+
FILEMODE= 04555
$(LIBPROG): $(OBJS)
diff --git a/usr/src/cmd/fs.d/ufs/quotacheck/Makefile b/usr/src/cmd/fs.d/ufs/quotacheck/Makefile
index 448d9f93cb..cb302325e4 100644
--- a/usr/src/cmd/fs.d/ufs/quotacheck/Makefile
+++ b/usr/src/cmd/fs.d/ufs/quotacheck/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/fs.d/ufs/quotacheck/Makefile
FSTYPE= ufs
LIBPROG= quotacheck
@@ -42,6 +39,9 @@ FSOBJS= preenlib.o
FSSRCS= ../../preenlib.c
SRCS= $(OBJS:.o=.c)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-type-limits
+
lint: lint_PROG
$(FSOBJS): $(FSSRCS)
diff --git a/usr/src/cmd/fs.d/ufs/quotaon/Makefile b/usr/src/cmd/fs.d/ufs/quotaon/Makefile
index 25a59643b9..b53e3dd85a 100644
--- a/usr/src/cmd/fs.d/ufs/quotaon/Makefile
+++ b/usr/src/cmd/fs.d/ufs/quotaon/Makefile
@@ -49,6 +49,9 @@ include ../../Makefile.fstype
$(ROOTINIT_SCRIPT) := FILEMODE = 0744
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+
lint: lint_PROG
$(ROOTLIBFSTYPE)/$(QUOTAOFF): $(ROOTLIBFSTYPE)/$(LIBPROG)
diff --git a/usr/src/cmd/fs.d/ufs/repquota/Makefile b/usr/src/cmd/fs.d/ufs/repquota/Makefile
index 8be1477321..600ca6b373 100644
--- a/usr/src/cmd/fs.d/ufs/repquota/Makefile
+++ b/usr/src/cmd/fs.d/ufs/repquota/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/fs.d/ufs/repquota/Makefile
FSTYPE= ufs
LIBPROG= repquota
@@ -37,6 +34,10 @@ LINKVALUE= ../lib/fs/$(FSTYPE)/$(LIBPROG)
include ../../Makefile.fstype
CPPFLAGS += -D_LARGEFILE64_SOURCE
+
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+
lint: lint_PROG
$(ROOTUSRSBIN)/$(LIBPROG):
diff --git a/usr/src/cmd/fs.d/ufs/roll_log/Makefile b/usr/src/cmd/fs.d/ufs/roll_log/Makefile
index f5f2d4efff..26f4e03e18 100644
--- a/usr/src/cmd/fs.d/ufs/roll_log/Makefile
+++ b/usr/src/cmd/fs.d/ufs/roll_log/Makefile
@@ -20,12 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1996,1997 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/fs.d/ufs/roll_log
include ../../Makefile.fstype
@@ -33,6 +30,8 @@ INCLUDES= roll_log.h
SRCS= roll_log.c
OBJS= $(SRCS:%.c=$(MACH)/%.o)
+CERRWARN += -_gcc=-Wno-switch
+
CLOBBERFILES= $(OBJS)
.KEEP_STATE:
diff --git a/usr/src/cmd/fs.d/ufs/tunefs/Makefile b/usr/src/cmd/fs.d/ufs/tunefs/Makefile
index e5cc12f8f9..858ea7c3d3 100644
--- a/usr/src/cmd/fs.d/ufs/tunefs/Makefile
+++ b/usr/src/cmd/fs.d/ufs/tunefs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989,1996, by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -38,6 +36,9 @@ include ../../Makefile.fstype
LDLIBS += -ladm
CPPFLAGS += -D_LARGEFILE64_SOURCE
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
lint: lint_PROG
$(ROOTUSRSBIN)/$(LIBPROG): FRC
diff --git a/usr/src/cmd/fs.d/ufs/volcopy/Makefile b/usr/src/cmd/fs.d/ufs/volcopy/Makefile
index 7a4ec018e6..9da5b17da5 100644
--- a/usr/src/cmd/fs.d/ufs/volcopy/Makefile
+++ b/usr/src/cmd/fs.d/ufs/volcopy/Makefile
@@ -23,8 +23,6 @@
# Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
FSTYPE= ufs
LIBPROG= volcopy
@@ -32,14 +30,17 @@ ATTMK= $(LIBPROG)
include ../../Makefile.fstype
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
+LDLIBS += -lmapmalloc
+
# for messaging catalog
#
-POFILE= volcopy.po
-XGETFLAGS += -a -x volcopy.xcl
+POFILE= volcopy.po
+XGETFLAGS += -a -x volcopy.xcl
catalog: $(POFILE)
-
-LDLIBS += -lmapmalloc
-
lint: lint_PROG
diff --git a/usr/src/cmd/fuser/Makefile b/usr/src/cmd/fuser/Makefile
index e2d937c724..8d4fee880a 100644
--- a/usr/src/cmd/fuser/Makefile
+++ b/usr/src/cmd/fuser/Makefile
@@ -23,14 +23,12 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/fuser/Makefile
PROG= fuser
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lkstat -ldevinfo
ROOTSYMLINK= $(ROOTETCPROG)
diff --git a/usr/src/cmd/fwflash/Makefile.com b/usr/src/cmd/fwflash/Makefile.com
index b4bd85b8a5..5f0873b244 100644
--- a/usr/src/cmd/fwflash/Makefile.com
+++ b/usr/src/cmd/fwflash/Makefile.com
@@ -28,6 +28,10 @@
CLOSED= $(SRC)/../closed
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
ROOTUSR= $(ROOT)/usr
ROOTUSRINCLD= $(ROOTUSR)/include
ROOTUSRINCLDFWFLASH= $(ROOTUSRINCLD)/fwflash
diff --git a/usr/src/cmd/gencat/Makefile b/usr/src/cmd/gencat/Makefile
index ed163b419e..f5ccbe0e45 100644
--- a/usr/src/cmd/gencat/Makefile
+++ b/usr/src/cmd/gencat/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -32,6 +30,9 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-value
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/geniconvtbl/Makefile.com b/usr/src/cmd/geniconvtbl/Makefile.com
index fbaee1ae2a..389ce98098 100644
--- a/usr/src/cmd/geniconvtbl/Makefile.com
+++ b/usr/src/cmd/geniconvtbl/Makefile.com
@@ -21,9 +21,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/geniconvtbl/Makefile.com
$(NOT_NATIVE)NATIVE_BUILD = $(POUND_SIGN)
@@ -87,6 +84,11 @@ CLEANFILES = $(OBJS) $(YTABC) $(YTABH) $(LEXYY) $(YOUT) \
$(POFILES) $(POFILE)
CPPFLAGS += -I. -I..
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
YFLAGS += -d -v
CFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/usr/src/cmd/genmsg/Makefile b/usr/src/cmd/genmsg/Makefile
index 45713eb235..aafd07c843 100644
--- a/usr/src/cmd/genmsg/Makefile
+++ b/usr/src/cmd/genmsg/Makefile
@@ -22,9 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/genmsg/Makefile
include ../Makefile.cmd
@@ -37,6 +34,10 @@ LEXSRCS= genmsg.l
LEXINTSRCS= lex.yy.c
LEXOBJS= lex.yy.o
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+
LDLIBS += -ll
YFLAGS = -d
CPPFLAGS = -I../head $(CPPFLAGS.master)
diff --git a/usr/src/cmd/getconf/Makefile b/usr/src/cmd/getconf/Makefile
index 8fb8d5d192..ed93052eec 100644
--- a/usr/src/cmd/getconf/Makefile
+++ b/usr/src/cmd/getconf/Makefile
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
PROG= getconf
XPG4PROG= getconf
@@ -38,6 +37,7 @@ include ../Makefile.cmd
XPG4EXOBJS += values-xpg4.o
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
# XPG4
$(XPG4) := CFLAGS += -D_XOPEN_SOURCE -I$(SRC)/lib/libc/inc
diff --git a/usr/src/cmd/getent/Makefile b/usr/src/cmd/getent/Makefile
index bb2dfd5caa..4b6e79c992 100644
--- a/usr/src/cmd/getent/Makefile
+++ b/usr/src/cmd/getent/Makefile
@@ -23,13 +23,14 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= getent
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
OBJECTS= \
dogetethers.o \
dogetgr.o \
diff --git a/usr/src/cmd/getfacl/Makefile b/usr/src/cmd/getfacl/Makefile
index 9eb8b4320e..575c1bd3cb 100644
--- a/usr/src/cmd/getfacl/Makefile
+++ b/usr/src/cmd/getfacl/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1993,2001 by Sun Microsystems, Inc.
# All rights reserved.
#
@@ -30,6 +28,9 @@ PROG= getfacl
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/grep/grep.c b/usr/src/cmd/grep/grep.c
index 62a4527529..edc83be3e6 100644
--- a/usr/src/cmd/grep/grep.c
+++ b/usr/src/cmd/grep/grep.c
@@ -52,6 +52,9 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <ftw.h>
+#include <limits.h>
+#include <sys/param.h>
static const char *errstr[] = {
"Range endpoint too large.",
@@ -73,6 +76,7 @@ static const char *errstr[] = {
#define errmsg(msg, arg) (void) fprintf(stderr, gettext(msg), arg)
#define BLKSIZE 512
#define GBUFSIZ 8192
+#define MAX_DEPTH 1000
static int temp;
static long long lnum;
@@ -83,6 +87,8 @@ static int nflag;
static int bflag;
static int lflag;
static int cflag;
+static int rflag;
+static int Rflag;
static int vflag;
static int sflag;
static int iflag;
@@ -93,13 +99,16 @@ static int errflg;
static int nfile;
static long long tln;
static int nsucc;
+static int outfn = 0;
static int nlflag;
static char *ptr, *ptrend;
static char *expbuf;
-static void execute(char *);
+static void execute(const char *, int);
static void regerr(int);
-static int succeed(char *);
+static void prepare(const char *);
+static int recursive(const char *, const struct stat *, int, struct FTW *);
+static int succeed(const char *);
int
main(int argc, char **argv)
@@ -114,7 +123,7 @@ main(int argc, char **argv)
#endif
(void) textdomain(TEXT_DOMAIN);
- while ((c = getopt(argc, argv, "hqblcnsviyw")) != -1)
+ while ((c = getopt(argc, argv, "hqblcnRrsviyw")) != -1)
switch (c) {
case 'h':
hflag++;
@@ -131,6 +140,12 @@ main(int argc, char **argv)
case 'n':
nflag++;
break;
+ case 'R':
+ Rflag++;
+ /* FALLTHROUGH */
+ case 'r':
+ rflag++;
+ break;
case 'b':
bflag++;
break;
@@ -152,7 +167,8 @@ main(int argc, char **argv)
}
if (errflg || (optind >= argc)) {
- errmsg("Usage: grep [-c|-l|-q] -hbnsviw pattern file . . .\n",
+ errmsg("Usage: grep [-c|-l|-q] [-r|-R] -hbnsviw "
+ "pattern file . . .\n",
(char *)NULL);
exit(2);
}
@@ -190,16 +206,80 @@ main(int argc, char **argv)
regerr(regerrno);
if (--argc == 0)
- execute(NULL);
+ execute(NULL, 0);
else
while (argc-- > 0)
- execute(*++argv);
+ prepare(*++argv);
return (nsucc == 2 ? 2 : (nsucc == 0 ? 1 : 0));
}
static void
-execute(char *file)
+prepare(const char *path)
+{
+ struct stat st;
+ int walkflags = FTW_CHDIR;
+ char *buf = NULL;
+
+ if (rflag) {
+ if (stat(path, &st) != -1 &&
+ (st.st_mode & S_IFMT) == S_IFDIR) {
+ outfn = 1;
+
+ /*
+ * Add trailing slash if arg
+ * is directory, to resolve symlinks.
+ */
+ if (path[strlen(path) - 1] != '/') {
+ (void) asprintf(&buf, "%s/", path);
+ if (buf != NULL)
+ path = buf;
+ }
+
+ /*
+ * Search through subdirs if path is directory.
+ * Don't follow symlinks if Rflag is not set.
+ */
+ if (!Rflag)
+ walkflags |= FTW_PHYS;
+
+ if (nftw(path, recursive, MAX_DEPTH, walkflags) != 0) {
+ if (!sflag)
+ errmsg("grep: can't open %s\n", path);
+ nsucc = 2;
+ }
+ return;
+ }
+ }
+ execute(path, 0);
+}
+
+static int
+recursive(const char *name, const struct stat *statp, int info, struct FTW *ftw)
+{
+ /*
+ * process files and follow symlinks if Rflag set.
+ */
+ if (info != FTW_F) {
+ if (!sflag &&
+ (info == FTW_SLN || info == FTW_DNR || info == FTW_NS)) {
+ /* report broken symlinks and unreadable files */
+ errmsg("grep: can't open %s\n", name);
+ }
+ return (0);
+ }
+
+ /* skip devices and pipes if Rflag is not set */
+ if (!Rflag && !S_ISREG(statp->st_mode))
+ return (0);
+
+ /* pass offset to relative name from FTW_CHDIR */
+ execute(name, ftw->base);
+ return (0);
+}
+
+static void
+execute(const char *file, int base)
{
char *lbuf, *p;
long count;
@@ -221,7 +301,7 @@ execute(char *file)
if (file == NULL)
temp = 0;
- else if ((temp = open(file, O_RDONLY)) == -1) {
+ else if ((temp = open(file + base, O_RDONLY)) == -1) {
if (!sflag)
errmsg("grep: can't open %s\n", file);
nsucc = 2;
@@ -235,6 +315,7 @@ execute(char *file)
if (cflag && !qflag) {
if (nfile > 1 && !hflag && file)
(void) fprintf(stdout, "%s:", file);
+ if (!rflag)
(void) fprintf(stdout, "%lld\n", tln);
}
return;
@@ -329,14 +410,15 @@ execute(char *file)
(void) close(temp);
if (cflag && !qflag) {
- if (nfile > 1 && !hflag && file)
+ if (!hflag && file && (nfile > 1 ||
+ (rflag && outfn)))
(void) fprintf(stdout, "%s:", file);
(void) fprintf(stdout, "%lld\n", tln);
}
}
static int
-succeed(char *f)
+succeed(const char *f)
{
int nchars;
nsucc = (nsucc == 2) ? 2 : 1;
@@ -359,9 +441,10 @@ succeed(char *f)
return (1);
}
- if (nfile > 1 && !hflag)
+ if (!hflag && (nfile > 1 || (rflag && outfn))) {
/* print filename */
(void) fprintf(stdout, "%s:", f);
+ }
if (bflag)
/* print block number */
diff --git a/usr/src/cmd/grep_xpg4/Makefile b/usr/src/cmd/grep_xpg4/Makefile
index d9dd84c032..fb7c7d1a58 100644
--- a/usr/src/cmd/grep_xpg4/Makefile
+++ b/usr/src/cmd/grep_xpg4/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -33,6 +31,9 @@ EFILE= egrep
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTXPG4LINKS = $(ROOTXPG4BIN)/$(FFILE) $(ROOTXPG4BIN)/$(EFILE)
CFLAGS += $(CCVERBOSE)
diff --git a/usr/src/cmd/grep_xpg4/grep.c b/usr/src/cmd/grep_xpg4/grep.c
index 2fa6506254..8bfd8d7ef9 100644
--- a/usr/src/cmd/grep_xpg4/grep.c
+++ b/usr/src/cmd/grep_xpg4/grep.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* grep - pattern matching program - combined grep, egrep, and fgrep.
* Based on MKS grep command, with XCU & Solaris mods.
@@ -36,6 +34,8 @@
*
*/
+/* Copyright 2012 Nexenta Systems, Inc. All rights reserved. */
+
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
@@ -51,9 +51,12 @@
#include <errno.h>
#include <unistd.h>
#include <wctype.h>
+#include <ftw.h>
+#include <sys/param.h>
#define BSIZE 512 /* Size of block for -b */
#define BUFSIZE 8192 /* Input buffer size */
+#define MAX_DEPTH 1000 /* how deep to recurse */
#define M_CSETSIZE 256 /* singlebyte chars */
static int bmglen; /* length of BMG pattern */
@@ -70,6 +73,8 @@ typedef struct _PATTERN {
static PATTERN *patterns;
static char errstr[128]; /* regerror string buffer */
static int regflags = 0; /* regcomp options */
+static int matched = 0; /* return of the grep() */
+static int errors = 0; /* count of errors */
static uchar_t fgrep = 0; /* Invoked as fgrep */
static uchar_t egrep = 0; /* Invoked as egrep */
static uchar_t nvflag = 1; /* Print matching lines */
@@ -78,6 +83,7 @@ static uchar_t iflag; /* Case insensitve matching */
static uchar_t hflag; /* Supress printing of filename */
static uchar_t lflag; /* Print file names of matches */
static uchar_t nflag; /* Precede lines by line number */
+static uchar_t rflag; /* Search directories recursively */
static uchar_t bflag; /* Preccede matches by block number */
static uchar_t sflag; /* Suppress file error messages */
static uchar_t qflag; /* Suppress standard output */
@@ -85,6 +91,7 @@ static uchar_t wflag; /* Search for expression as a word */
static uchar_t xflag; /* Anchoring */
static uchar_t Eflag; /* Egrep or -E flag */
static uchar_t Fflag; /* Fgrep or -F flag */
+static uchar_t Rflag; /* Like rflag, but follow symlinks */
static uchar_t outfn; /* Put out file name */
static char *cmdname;
@@ -94,13 +101,16 @@ static size_t outbuflen, prntbuflen;
static char *prntbuf;
static wchar_t *outline;
-static void addfile(char *fn);
+static void addfile(const char *fn);
static void addpattern(char *s);
static void fixpatterns(void);
static void usage(void);
-static int grep(int, char *);
+static int grep(int, const char *);
static void bmgcomp(char *, int);
static char *bmgexec(char *, char *);
+static int recursive(const char *, const struct stat *, int, struct FTW *);
+static void process_path(const char *);
+static void process_file(const char *, int);
/*
* mainline for grep
@@ -109,10 +119,8 @@ int
main(int argc, char **argv)
{
char *ap;
- int matched = 0;
int c;
int fflag = 0;
- int errors = 0;
int i, n_pattern = 0, n_file = 0;
char **pattern_list = NULL;
char **file_list = NULL;
@@ -147,7 +155,7 @@ main(int argc, char **argv)
}
}
- while ((c = getopt(argc, argv, "vwchilnbse:f:qxEFI")) != EOF) {
+ while ((c = getopt(argc, argv, "vwchilnrbse:f:qxEFIR")) != EOF) {
switch (c) {
case 'v': /* POSIX: negate matches */
nvflag = 0;
@@ -170,6 +178,10 @@ main(int argc, char **argv)
nflag++;
break;
+ case 'r': /* Solaris: search recursively */
+ rflag++;
+ break;
+
case 'b': /* Solaris: Write file block numbers */
bflag++;
break;
@@ -230,6 +242,11 @@ main(int argc, char **argv)
Fflag++;
break;
+ case 'R': /* Solaris: like rflag, but follow symlinks */
+ Rflag++;
+ rflag++;
+ break;
+
default:
usage();
}
@@ -334,21 +351,7 @@ main(int argc, char **argv)
if (argc > 2 && hflag == 0)
outfn = 1; /* Print filename on match line */
for (argv++; *argv != NULL; argv++) {
- int fd;
-
- if ((fd = open(*argv, O_RDONLY)) == -1) {
- errors = 1;
- if (sflag)
- continue;
- (void) fprintf(stderr, gettext(
- "%s: can't open \"%s\"\n"),
- cmdname, *argv);
- continue;
- }
- matched |= grep(fd, *argv);
- (void) close(fd);
- if (ferror(stdout))
- break;
+ process_path(*argv);
}
}
/*
@@ -362,11 +365,110 @@ main(int argc, char **argv)
return (matched ? 0 : 1);
}
+static void
+process_path(const char *path)
+{
+ struct stat st;
+ int walkflags = FTW_CHDIR;
+ char *buf = NULL;
+
+ if (rflag) {
+ if (stat(path, &st) != -1 &&
+ (st.st_mode & S_IFMT) == S_IFDIR) {
+ outfn = 1; /* Print filename */
+
+ /*
+ * Add trailing slash if arg
+ * is directory, to resolve symlinks.
+ */
+ if (path[strlen(path) - 1] != '/') {
+ (void) asprintf(&buf, "%s/", path);
+ if (buf != NULL)
+ path = buf;
+ }
+
+ /*
+ * Search through subdirs if path is directory.
+ * Don't follow symlinks if Rflag is not set.
+ */
+ if (!Rflag)
+ walkflags |= FTW_PHYS;
+
+ if (nftw(path, recursive, MAX_DEPTH, walkflags) != 0) {
+ if (!sflag)
+ (void) fprintf(stderr,
+ gettext("%s: can't open \"%s\"\n"),
+ cmdname, path);
+ errors = 1;
+ }
+ return;
+ }
+ }
+ process_file(path, 0);
+}
+
+/*
+ * Read and process all files in directory recursively.
+ */
+static int
+recursive(const char *name, const struct stat *statp, int info, struct FTW *ftw)
+{
+ /*
+ * Process files and follow symlinks if Rflag set.
+ */
+ if (info != FTW_F) {
+ /* Report broken symlinks and unreadable files */
+ if (!sflag &&
+ (info == FTW_SLN || info == FTW_DNR || info == FTW_NS)) {
+ (void) fprintf(stderr,
+ gettext("%s: can't open \"%s\"\n"), cmdname, name);
+ }
+ return (0);
+ }
+
+
+ /* Skip devices and pipes if Rflag is not set */
+ if (!Rflag && !S_ISREG(statp->st_mode))
+ return (0);
+ /* Pass offset to relative name from FTW_CHDIR */
+ process_file(name, ftw->base);
+ return (0);
+}
+
+/*
+ * Opens file and call grep function.
+ */
+static void
+process_file(const char *name, int base)
+{
+ int fd;
+
+ if ((fd = open(name + base, O_RDONLY)) == -1) {
+ errors = 1;
+ if (!sflag) /* Silent mode */
+ (void) fprintf(stderr, gettext(
+ "%s: can't open \"%s\"\n"),
+ cmdname, name);
+ return;
+ }
+ matched |= grep(fd, name);
+ (void) close(fd);
+
+ if (ferror(stdout)) {
+ (void) fprintf(stderr, gettext(
+ "%s: error writing to stdout\n"),
+ cmdname);
+ (void) fflush(stdout);
+ exit(2);
+ }
+
+}
+
/*
* Add a file of strings to the pattern list.
*/
static void
-addfile(char *fn)
+addfile(const char *fn)
{
FILE *fp;
char *inbuf;
@@ -528,7 +630,7 @@ fixpatterns(void)
size_t n;
n = strlen(pp->pattern) + 1;
if ((pp->wpattern =
- malloc(sizeof (wchar_t) * n)) == NULL) {
+ malloc(sizeof (wchar_t) * n)) == NULL) {
(void) fprintf(stderr,
gettext("%s: out of memory\n"),
cmdname);
@@ -538,7 +640,7 @@ fixpatterns(void)
(size_t)-1) {
(void) fprintf(stderr,
gettext("%s: failed to convert "
- "\"%s\" to wide-characters\n"),
+ "\"%s\" to wide-characters\n"),
cmdname, pp->pattern);
exit(2);
}
@@ -579,7 +681,7 @@ fixpatterns(void)
(void) regerror(rv, &pp->re, errstr, sizeof (errstr));
(void) fprintf(stderr,
gettext("%s: RE error in %s: %s\n"),
- cmdname, pp->pattern, errstr);
+ cmdname, pp->pattern, errstr);
exit(2);
}
free(pp->pattern);
@@ -675,7 +777,7 @@ istrdup(const char *s1)
* and check for a match on each line.
*/
static int
-grep(int fd, char *fn)
+grep(int fd, const char *fn)
{
PATTERN *pp;
off_t data_len; /* length of the data chunk */
@@ -740,11 +842,11 @@ grep(int fd, char *fn)
if (count < 0) {
/* read error */
if (cflag) {
- if (outfn) {
+ if (outfn && !rflag) {
(void) fprintf(stdout,
"%s:", fn);
}
- if (!qflag) {
+ if (!qflag && !rflag) {
(void) fprintf(stdout, "%lld\n",
matches);
}
@@ -859,7 +961,7 @@ L_start_process:
* need to handle xflag if specified
*/
if (xflag && (line_len != bmglen ||
- strcmp(bmgpat, ptr) != 0)) {
+ strcmp(bmgpat, ptr) != 0)) {
/* didn't match */
pp = NULL;
} else {
@@ -915,7 +1017,7 @@ L_start_process:
for (pp = patterns; pp; pp = pp->next) {
if (outline[0] == pp->wpattern[0] &&
wcscmp(outline,
- pp->wpattern) == 0) {
+ pp->wpattern) == 0) {
/* matched */
break;
}
@@ -1056,43 +1158,46 @@ usage(void)
if (egrep || fgrep) {
(void) fprintf(stderr, gettext("Usage:\t%s"), cmdname);
(void) fprintf(stderr,
- gettext(" [-c|-l|-q] [-bhinsvx] "
- "pattern_list [file ...]\n"));
+ gettext(" [-c|-l|-q] [-r|-R] [-bhinsvx] "
+ "pattern_list [file ...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
- gettext(" [-c|-l|-q] [-bhinsvx] [-e pattern_list]... "
- "[-f pattern_file]... [file...]\n"));
+ gettext(" [-c|-l|-q] [-r|-R] [-bhinsvx] "
+ "[-e pattern_list]... "
+ "[-f pattern_file]... [file...]\n"));
} else {
(void) fprintf(stderr, gettext("Usage:\t%s"), cmdname);
(void) fprintf(stderr,
- gettext(" [-c|-l|-q] [-bhinsvwx] "
- "pattern_list [file ...]\n"));
+ gettext(" [-c|-l|-q] [-r|-R] [-bhinsvwx] "
+ "pattern_list [file ...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
- gettext(" [-c|-l|-q] [-bhinsvwx] [-e pattern_list]... "
- "[-f pattern_file]... [file...]\n"));
+ gettext(" [-c|-l|-q] [-r|-R] [-bhinsvwx] "
+ "[-e pattern_list]... "
+ "[-f pattern_file]... [file...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
- gettext(" -E [-c|-l|-q] [-bhinsvx] "
- "pattern_list [file ...]\n"));
+ gettext(" -E [-c|-l|-q] [-r|-R] [-bhinsvx] "
+ "pattern_list [file ...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
- gettext(" -E [-c|-l|-q] [-bhinsvx] [-e pattern_list]... "
- "[-f pattern_file]... [file...]\n"));
+ gettext(" -E [-c|-l|-q] [-r|-R] [-bhinsvx] "
+ "[-e pattern_list]... "
+ "[-f pattern_file]... [file...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
- gettext(" -F [-c|-l|-q] [-bhinsvx] "
- "pattern_list [file ...]\n"));
+ gettext(" -F [-c|-l|-q] [-r|-R] [-bhinsvx] "
+ "pattern_list [file ...]\n"));
(void) fprintf(stderr, "\t%s", cmdname);
(void) fprintf(stderr,
gettext(" -F [-c|-l|-q] [-bhinsvx] [-e pattern_list]... "
- "[-f pattern_file]... [file...]\n"));
+ "[-f pattern_file]... [file...]\n"));
}
exit(2);
/* NOTREACHED */
diff --git a/usr/src/cmd/groups/Makefile b/usr/src/cmd/groups/Makefile
index 522945a8d8..22812f5968 100644
--- a/usr/src/cmd/groups/Makefile
+++ b/usr/src/cmd/groups/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,8 @@ PROG= groups
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/grpck/Makefile b/usr/src/cmd/grpck/Makefile
index 596b9992be..3a06b0d9cd 100644
--- a/usr/src/cmd/grpck/Makefile
+++ b/usr/src/cmd/grpck/Makefile
@@ -20,17 +20,15 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1990 by Sun Microsystems, Inc.
#
-# cmd/grpck/Makefile
-#
PROG= grpck
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-variable
+
RELUSRSBIN= ../usr/sbin
ROOTSYMLINK= $(ROOTETC)/$(PROG)
diff --git a/usr/src/cmd/gss/gssd/Makefile b/usr/src/cmd/gss/gssd/Makefile
index 18b4bcdfca..16bac17941 100644
--- a/usr/src/cmd/gss/gssd/Makefile
+++ b/usr/src/cmd/gss/gssd/Makefile
@@ -70,6 +70,11 @@ DIRS= $(ROOTLIB)
CPPFLAGS += -I$(SRC)/uts/common/gssapi/include
COPTFLAG += $(XESS) #-I$(KINCDIR)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lgss -lnsl
gssd := MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
diff --git a/usr/src/cmd/hal/Makefile.hal b/usr/src/cmd/hal/Makefile.hal
index 260d1c466f..fc3a54f617 100644
--- a/usr/src/cmd/hal/Makefile.hal
+++ b/usr/src/cmd/hal/Makefile.hal
@@ -63,3 +63,10 @@ HAL_GLIB_CPPFLAGS = -I$(ADJUNCT_PROTO)/usr/include/glib-2.0 \
HAL_GETTEXT_PACKAGE = $(TEXT_DOMAIN)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/halt/Makefile b/usr/src/cmd/halt/Makefile
index fb22435c48..3eb9fddfc7 100644
--- a/usr/src/cmd/halt/Makefile
+++ b/usr/src/cmd/halt/Makefile
@@ -47,6 +47,8 @@ CPPFLAGS += -I../../lib/libzpool/common
CPPFLAGS += -I../../lib/libscf/inc
CPPFLAGS += -I../../uts/common/fs/zfs
+CERRWARN += -_gcc=-Wno-unused-label
+
LDLIBS += -lbsm -lscf -lzfs -lgen
LDLIBS_i386 += -lgrubmgmt
LDLIBS += $(LDLIBS_$(MACH))
diff --git a/usr/src/cmd/hotplugd/Makefile b/usr/src/cmd/hotplugd/Makefile
index 405d183d21..2a7be28033 100644
--- a/usr/src/cmd/hotplugd/Makefile
+++ b/usr/src/cmd/hotplugd/Makefile
@@ -43,6 +43,8 @@ ROOTMANIFESTDIR= $(ROOTSVCSYSTEM)
$(ROOTMANIFEST) := FILEMODE= 444
CPPFLAGS += -I$(SRC)/lib/libhotplug/common
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -ldevinfo -lhotplug -lnvpair -lsecdb -lrcm -lbsm
.KEEP_STATE:
diff --git a/usr/src/cmd/id/Makefile b/usr/src/cmd/id/Makefile
index e81b8c03e2..e6c3eef31a 100644
--- a/usr/src/cmd/id/Makefile
+++ b/usr/src/cmd/id/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -31,6 +29,9 @@ XPG4PROG= id
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
diff --git a/usr/src/cmd/idmap/idmap/Makefile b/usr/src/cmd/idmap/idmap/Makefile
index fa12170f8a..17e3e1574d 100644
--- a/usr/src/cmd/idmap/idmap/Makefile
+++ b/usr/src/cmd/idmap/idmap/Makefile
@@ -33,6 +33,14 @@ IDMAP_PROT_DIR = $(SRC)/head/rpcsvc
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
POFILE = $(PROG)_all.po
LDLIBS += -lidmap -ladutils -lsldap -lldap
FILEMODE = 0555
diff --git a/usr/src/cmd/idmap/idmapd/Makefile b/usr/src/cmd/idmap/idmapd/Makefile
index 14f41b73c7..f1aef3d137 100644
--- a/usr/src/cmd/idmap/idmapd/Makefile
+++ b/usr/src/cmd/idmap/idmapd/Makefile
@@ -55,6 +55,10 @@ SQLITELINT = $(ROOT)/usr/lib/llib-lsqlite.ln
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
TEXT_DOMAIN = SUNW_OST_OSLIB
XGETTEXT = $(GNUXGETTEXT)
XGETFLAGS = --foreign-user --strict -n -E --width=72 \
@@ -77,7 +81,7 @@ INCS += -I. -I../../../lib/libidmap/common\
$(OBJS) := CPPFLAGS += $(INCS) -D_REENTRANT
$(POFILE) := CPPFLAGS += $(INCS)
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
LDLIBS += -lsecdb \
-lsocket \
-lnsl \
diff --git a/usr/src/cmd/init/Makefile b/usr/src/cmd/init/Makefile
index 1a4d7c7bb8..a867a0e780 100644
--- a/usr/src/cmd/init/Makefile
+++ b/usr/src/cmd/init/Makefile
@@ -32,6 +32,8 @@ DEFAULTFILES= init.dfl
include ../Makefile.cmd
LDLIBS += -lpam -lbsm -lcontract -lscf
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
CLOBBERFILES= $(STATIC)
diff --git a/usr/src/cmd/intrstat/Makefile.com b/usr/src/cmd/intrstat/Makefile.com
index e766172423..6c25d6f020 100644
--- a/usr/src/cmd/intrstat/Makefile.com
+++ b/usr/src/cmd/intrstat/Makefile.com
@@ -38,6 +38,7 @@ SRCS += $(STAT_COMMON_SRCS)
CPPFLAGS += -I$(STATCOMMONDIR)
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -ldtrace
FILEMODE = 0555
diff --git a/usr/src/cmd/ipf/Makefile.ipf b/usr/src/cmd/ipf/Makefile.ipf
index 472785cf8b..fa151be780 100644
--- a/usr/src/cmd/ipf/Makefile.ipf
+++ b/usr/src/cmd/ipf/Makefile.ipf
@@ -34,3 +34,10 @@ KERNELIPF= $(SRC)/uts/common/inet/pfil
CPPFLAGS += -I$(COMMONIPF) -I$(KERNELIPF) -DSUNDDI -DUSE_INET6 \
-DSOLARIS2=$(RELEASE_MINOR)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-empty-body
diff --git a/usr/src/cmd/isainfo/Makefile b/usr/src/cmd/isainfo/Makefile
index c1958322df..4089921bfb 100644
--- a/usr/src/cmd/isainfo/Makefile
+++ b/usr/src/cmd/isainfo/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= isainfo
@@ -36,6 +34,7 @@ include ../Makefile.cmd
CPPFLAGS += -I$(ELFCAP) -I../../uts/common
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-type-limits
.KEEP_STATE:
diff --git a/usr/src/cmd/iscsiadm/Makefile b/usr/src/cmd/iscsiadm/Makefile
index c9585b3190..0249e9d347 100644
--- a/usr/src/cmd/iscsiadm/Makefile
+++ b/usr/src/cmd/iscsiadm/Makefile
@@ -37,6 +37,12 @@ LDLIBS += -lnsl -ldevinfo -lima
CPPFLAGS += -DSOLARIS
CPPFLAGS += -I.
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
FILEMODE= 0555
.KEEP_STATE:
diff --git a/usr/src/cmd/isns/isnsadm/Makefile b/usr/src/cmd/isns/isnsadm/Makefile
index 1eaf479984..e121b27ff0 100644
--- a/usr/src/cmd/isns/isnsadm/Makefile
+++ b/usr/src/cmd/isns/isnsadm/Makefile
@@ -37,6 +37,9 @@ POFILES = $(OBJS:%.o=%.po)
LINTFLAGS += -xerroff=E_BAD_FORMAT_STR2
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/isns/isnsd/Makefile b/usr/src/cmd/isns/isnsd/Makefile
index 054beb31d4..aaecd2ae6f 100644
--- a/usr/src/cmd/isns/isnsd/Makefile
+++ b/usr/src/cmd/isns/isnsd/Makefile
@@ -58,6 +58,11 @@ LINTFLAGS += -xerroff=E_BAD_PTR_CAST_ALIGN
LINTFLAGS += -xerroff=E_NAME_USED_NOT_DEF2
LINTFLAGS += -xerroff=E_CASE_FALLTHRU
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-ignored-qualifiers
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
obj.o := CERRWARN += -erroff=E_CONST_OBJ_SHOULD_HAVE_INITIZR
obj.o := CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT
diff --git a/usr/src/cmd/kbd/Makefile b/usr/src/cmd/kbd/Makefile
index 7bcc2244b5..935ff52681 100644
--- a/usr/src/cmd/kbd/Makefile
+++ b/usr/src/cmd/kbd/Makefile
@@ -33,6 +33,7 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
PROG = kbd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lscf
all: $(PROG)
diff --git a/usr/src/cmd/keyserv/Makefile b/usr/src/cmd/keyserv/Makefile
index a02e26fcbb..946579dfd2 100644
--- a/usr/src/cmd/keyserv/Makefile
+++ b/usr/src/cmd/keyserv/Makefile
@@ -67,6 +67,13 @@ $(ROOTKEYSERVDFLT) := FILEMODE= 444
CPPFLAGS += -I. -I$(SRC)/lib/libnsl/include -I$(SRC)/lib/libsldap/common \
-D_REENTRANT
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
+
LDLIBS += -lnsl
chkey := LDLIBS += -lsldap
keyserv := LDLIBS += -lmp
diff --git a/usr/src/cmd/krb5/kadmin/cli/Makefile b/usr/src/cmd/krb5/kadmin/cli/Makefile
index 8775328c49..ea7dc52f6d 100644
--- a/usr/src/cmd/krb5/kadmin/cli/Makefile
+++ b/usr/src/cmd/krb5/kadmin/cli/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kadmin kadmin.local
SHFILES= k5srvutil
@@ -33,6 +31,12 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include/ \
-I$(SRC)/lib/krb5 \
-I$(SRC)/lib/gss_mechs/mech_krb5/include $(DEFS)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+
COPTFLAG += $(XESS) #-I$(KINCDIR)
SHAREDLIBS = -lmech_krb5 -lss
diff --git a/usr/src/cmd/krb5/kadmin/dbutil/Makefile b/usr/src/cmd/krb5/kadmin/dbutil/Makefile
index cf9479aeac..9590430b9c 100644
--- a/usr/src/cmd/krb5/kadmin/dbutil/Makefile
+++ b/usr/src/cmd/krb5/kadmin/dbutil/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kdb5_util
@@ -37,6 +35,11 @@ CPPFLAGS += -I. -I$(SRC)/lib/gss_mechs/mech_krb5/include/kerberosIV \
-DUSE_KADM5_API_VERSION=2
COPTFLAG += $(XESS) #-I$(KINCDIR)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -L $(ROOT_KLIBDIR) -L $(KRB5LIB) -lkadm5srv -lkdb \
-lmech_krb5 -lnsl
diff --git a/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com b/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com
index bd5e19d6bd..a4651e8604 100644
--- a/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com
+++ b/usr/src/cmd/krb5/kadmin/gui/native/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libkadmin.a
VERS= .1
@@ -47,6 +45,10 @@ CPPFLAGS += -I../ -I$(SRC)/lib/krb5 \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-I$(JAVA_ROOT)/include -I$(JAVA_ROOT)/include/solaris
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+
LDLIBS += $(KMECHLIB) -L$(ROOT)/$(KERBLIBDIR) -lkadm5clnt -lsocket -lc
DYNFLAGS += $(KRUNPATH) $(KERBRUNPATH)
diff --git a/usr/src/cmd/krb5/kadmin/kclient/Makefile b/usr/src/cmd/krb5/kadmin/kclient/Makefile
index 4e76e4054b..bcc097899c 100644
--- a/usr/src/cmd/krb5/kadmin/kclient/Makefile
+++ b/usr/src/cmd/krb5/kadmin/kclient/Makefile
@@ -60,6 +60,10 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include \
-I$(SRC)/uts/common/gssapi/include \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+
ksetpw:= LDFLAGS += $(KRUNPATH)
kdyndns:= LDFLAGS += -R/usr/lib/smbsrv
ksmb:= LDFLAGS += -R/usr/lib/smbsrv
diff --git a/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile b/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile
index 88a7aedfef..0bbbba7255 100644
--- a/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile
+++ b/usr/src/cmd/krb5/kadmin/kdcmgr/Makefile
@@ -21,10 +21,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# Makefile for Kerberos server-install utility.
-#
PROG= kdcmgr
KLPROG= klookup
@@ -38,6 +34,9 @@ include ../../../Makefile.cmd
POFILE= $(SSRCS:%.sh=%.po)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lresolv -lnsl
.KEEP_STATE:
diff --git a/usr/src/cmd/krb5/kadmin/kpasswd/Makefile b/usr/src/cmd/krb5/kadmin/kpasswd/Makefile
index 945fbdd7cb..7ace844269 100644
--- a/usr/src/cmd/krb5/kadmin/kpasswd/Makefile
+++ b/usr/src/cmd/krb5/kadmin/kpasswd/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kpasswd
@@ -33,6 +31,10 @@ CPPFLAGS += -I$(SRC)/lib/gss_mechs/mech_krb5/include \
COPTFLAG += $(XESS) #-I$(KINCDIR)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -L $(KRB5LIBDIR)
LDLIBS += $(KMECHLIB) $(KCLNTLIB)
diff --git a/usr/src/cmd/krb5/kadmin/ktutil/Makefile b/usr/src/cmd/krb5/kadmin/ktutil/Makefile
index 9c9417d1de..652f88110c 100644
--- a/usr/src/cmd/krb5/kadmin/ktutil/Makefile
+++ b/usr/src/cmd/krb5/kadmin/ktutil/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= ktutil
@@ -27,6 +25,9 @@ CPPFLAGS += -I$(SRC)/uts/common/gssapi/include \
-DHAVE_TIMEZONE
COPTFLAG += $(XESS) #-I$(KINCDIR)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-function
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += $(KMECHLIB) $(ROOT)$(KERBLIBDIR)/libss.so
diff --git a/usr/src/cmd/krb5/kadmin/server/Makefile b/usr/src/cmd/krb5/kadmin/server/Makefile
index 0fbf9e5b8e..6e8e7c25f9 100644
--- a/usr/src/cmd/krb5/kadmin/server/Makefile
+++ b/usr/src/cmd/krb5/kadmin/server/Makefile
@@ -42,6 +42,11 @@ CPPFLAGS += -I. -I$(SRC)/uts/common/gssapi/mechs/krb5/include \
COPTFLAG += $(XESS) #-I$(KINCDIR)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -lgss -L$(KRB5LIB) \
-lmech_krb5 -lkadm5srv -lkdb -lnsl -lresolv -lbsm -lpam -lsocket
diff --git a/usr/src/cmd/krb5/kdestroy/Makefile b/usr/src/cmd/krb5/kdestroy/Makefile
index ba3d4515a8..fe8cb0f058 100644
--- a/usr/src/cmd/krb5/kdestroy/Makefile
+++ b/usr/src/cmd/krb5/kdestroy/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kdestroy
@@ -14,6 +12,9 @@ SRCS = kdestroy.c krpc_sys.c
include ../../Makefile.cmd
include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+
POFILE = kdestroy.po
POFILES = generic.po
diff --git a/usr/src/cmd/krb5/kinit/Makefile b/usr/src/cmd/krb5/kinit/Makefile
index 8603af381e..8aaaac2990 100644
--- a/usr/src/cmd/krb5/kinit/Makefile
+++ b/usr/src/cmd/krb5/kinit/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kinit
@@ -15,6 +13,10 @@ DEFS = -DHAVE_LIBSOCKET=1 -DHAVE_LIBNSL=1 -DHAVE_PWD_H=1 -DHAVE_COMPILE=1 -DHAV
include ../../Makefile.cmd
include $(SRC)/lib/gss_mechs/mech_krb5/Makefile.mech_krb5
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-parentheses
+
POFILE = kinit.po
POFILES = generic.po
diff --git a/usr/src/cmd/krb5/klist/Makefile b/usr/src/cmd/krb5/klist/Makefile
index f28e8a4367..4485ade155 100644
--- a/usr/src/cmd/krb5/klist/Makefile
+++ b/usr/src/cmd/krb5/klist/Makefile
@@ -26,6 +26,7 @@ CPPFLAGS += -I$(SRC)/lib/gss_mechs/mech_krb5/include \
LDFLAGS += $(KRUNPATH)
LDLIBS += $(KMECHLIB)
+CERRWARN += -_gcc=-Wno-unused-function
$(GPROGS) := CPPFLAGS += -DSYSV -DSunOS=50
diff --git a/usr/src/cmd/krb5/kproplog/Makefile b/usr/src/cmd/krb5/kproplog/Makefile
index 9fa8ab9c7b..6cade7d181 100644
--- a/usr/src/cmd/krb5/kproplog/Makefile
+++ b/usr/src/cmd/krb5/kproplog/Makefile
@@ -2,8 +2,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = kproplog
@@ -35,6 +33,10 @@ CPPFLAGS += -I. -I$(SRC)/lib/krb5 \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
all: $(PROG)
$(PROG): $(OBJS) $(DERIVED_OBJS)
diff --git a/usr/src/cmd/krb5/krb5kdc/Makefile b/usr/src/cmd/krb5/krb5kdc/Makefile
index 72d02fb2d2..ac3e00b0f3 100644
--- a/usr/src/cmd/krb5/krb5kdc/Makefile
+++ b/usr/src/cmd/krb5/krb5kdc/Makefile
@@ -42,7 +42,7 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKSECURITY)
CFLAGS += $(CCOPTS) $(DEFS) $(LOCALINCLUDE)
# The SET macros in network.c will be mis-optimized if GCC believes it
# may rely on undefined signed overflow behaviour.
-$(__GNUC4)CFLAGS += -_gcc=-fno-strict-overflow
+CFLAGS += -_gcc=-fno-strict-overflow
CPPFLAGS += \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
@@ -50,6 +50,12 @@ CPPFLAGS += \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include \
-DHAVE_SYSLOG_H=1
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -L$(ROOT_KLIBDIR) -L$(KRB5LIB) \
-lmech_krb5 -lkdb -lkadm5srv -lnsl -lsocket -lbsm -lc
diff --git a/usr/src/cmd/krb5/kwarn/Makefile b/usr/src/cmd/krb5/kwarn/Makefile
index c2dcc058ce..7dc7c8dc7a 100644
--- a/usr/src/cmd/krb5/kwarn/Makefile
+++ b/usr/src/cmd/krb5/kwarn/Makefile
@@ -23,8 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
TESTPROG = kwarndtest
@@ -53,6 +51,11 @@ POFILES = generic.po
COPTFLAG += $(XESS) #-I$(KINCDIR)
CPPFLAGS += -D_REENTRANT
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+
CPPFLAGS += -I../../lib/gss_mechs/mech_krb5/include \
-I$(SRC)/lib/gss_mechs/mech_krb5 \
-I$(SRC)/lib/gss_mechs/mech_krb5/include \
diff --git a/usr/src/cmd/krb5/ldap_util/Makefile b/usr/src/cmd/krb5/ldap_util/Makefile
index d6b323cbdb..261ef5e89e 100644
--- a/usr/src/cmd/krb5/ldap_util/Makefile
+++ b/usr/src/cmd/krb5/ldap_util/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= kdb5_ldap_util
@@ -62,6 +60,11 @@ CPPFLAGS += \
-I../kwarn \
$(DEFS)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -L $(ROOT_KLIBDIR) -L $(KRB5LIB) -lkadm5srv -lkdb -lkdb_ldap \
-lmech_krb5
diff --git a/usr/src/cmd/krb5/slave/Makefile b/usr/src/cmd/krb5/slave/Makefile
index 592a6f08c0..ffae1e2c8b 100644
--- a/usr/src/cmd/krb5/slave/Makefile
+++ b/usr/src/cmd/krb5/slave/Makefile
@@ -2,8 +2,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG1=kprop
PROG2=kpropd
@@ -57,6 +55,14 @@ CPPFLAGS += -I. \
-I$(SRC)/lib/krb5/kadm5 \
-I$(SRC)/uts/common/gssapi/mechs/krb5/include
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-address
+
LDFLAGS += $(KRUNPATH) $(KERBRUNPATH)
LDLIBS += -lmech_krb5 -lsocket
$(PROG1) := LDLIBS += -L$(KRB5LIB) -lkadm5srv
diff --git a/usr/src/cmd/ksh/Makefile.com b/usr/src/cmd/ksh/Makefile.com
index 75685dfa18..8716f4eb9d 100644
--- a/usr/src/cmd/ksh/Makefile.com
+++ b/usr/src/cmd/ksh/Makefile.com
@@ -59,6 +59,7 @@ CFLAGS64 += \
$(ASTCFLAGS64)
# Workaround for CR#6628728 ("|memcntl()| prototype not available for C99/XPG6")
+pmain.o := CERRWARN += -_gcc=-Wno-implicit-function-declaration
pmain.o := CERRWARN += -erroff=E_NO_IMPLICIT_DECL_ALLOWED
.KEEP_STATE:
diff --git a/usr/src/cmd/ksh/builtins/Makefile b/usr/src/cmd/ksh/builtins/Makefile
index 40bde75ea2..e4c0e8aa7a 100644
--- a/usr/src/cmd/ksh/builtins/Makefile
+++ b/usr/src/cmd/ksh/builtins/Makefile
@@ -90,8 +90,8 @@ ROOTALIASPROG= $(ALIASPROG:%=$(ROOTBIN)/%)
include ../../Makefile.cmd
$(SPARC_BLD)include ../../Makefile.cmd.64
-
FILEMODE= 555
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/latencytop/Makefile.com b/usr/src/cmd/latencytop/Makefile.com
index a50d7a1c76..32e74087c8 100644
--- a/usr/src/cmd/latencytop/Makefile.com
+++ b/usr/src/cmd/latencytop/Makefile.com
@@ -34,6 +34,9 @@ CFLAGS64 += $(CCVERBOSE)
CPPFLAGS += -DEMBED_CONFIGS -I$(ADJUNCT_PROTO)/usr/include/glib-2.0 \
-I$(ADJUNCT_PROTO)/usr/lib/glib-2.0/include
+CERRWARN += -_gcc=-Wno-uninitialized
+
+CPPFLAGS += -DEMBED_CONFIGS -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
C99MODE = $(C99_ENABLE)
LDLIBS += -lcurses -ldtrace
all install := LDLIBS += -lglib-2.0
diff --git a/usr/src/cmd/ldap/Makefile.com b/usr/src/cmd/ldap/Makefile.com
index ac19112be5..a50e846b61 100644
--- a/usr/src/cmd/ldap/Makefile.com
+++ b/usr/src/cmd/ldap/Makefile.com
@@ -83,6 +83,12 @@ ROOTVAR_LDAP= $(ROOT)/var/ldap
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2
LINTFLAGS += -erroff=E_INCONS_VAL_TYPE_DECL2
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
all:= TARGET= all
install:= TARGET= install
clean:= TARGET= clean
diff --git a/usr/src/cmd/ldapcachemgr/Makefile b/usr/src/cmd/ldapcachemgr/Makefile
index 46f61f28b8..12574d5c68 100644
--- a/usr/src/cmd/ldapcachemgr/Makefile
+++ b/usr/src/cmd/ldapcachemgr/Makefile
@@ -51,6 +51,10 @@ CPPFLAGS += -D_REENTRANT -DSUN_THREADS \
-I$(SRC)/lib/libldap5/include/ldap \
-I$(SRC)/lib/libc/port/gen
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
# Message files
POFILE= ldap_cachemgr.po
POFILES= ${OBJS:%.o=%.po}
diff --git a/usr/src/cmd/ldmad/Makefile b/usr/src/cmd/ldmad/Makefile
index 2cb1906509..9e9e30fc19 100644
--- a/usr/src/cmd/ldmad/Makefile
+++ b/usr/src/cmd/ldmad/Makefile
@@ -65,6 +65,7 @@ INCS += -I$(ROOT)/usr/platform/sun4v/include/sys
INCS += -I$(SRC)/uts/sun4v
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(INCS)
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-uninitialized
LINTFLAGS += -erroff=E_BAD_PTR_CAST_ALIGN
diff --git a/usr/src/cmd/link/Makefile b/usr/src/cmd/link/Makefile
index 5fa3027851..d9f3e9f5d1 100644
--- a/usr/src/cmd/link/Makefile
+++ b/usr/src/cmd/link/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= link
XPG4PROG= link
@@ -36,6 +34,8 @@ clean $(XPG4) := OBJS += values-xpg4.o
FILEMODE= 0555
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG) $(XPG4)
diff --git a/usr/src/cmd/listen/Makefile b/usr/src/cmd/listen/Makefile
index 5fa1bfe3c2..902064e388 100644
--- a/usr/src/cmd/listen/Makefile
+++ b/usr/src/cmd/listen/Makefile
@@ -57,6 +57,12 @@ LDFLAGS += $(MAPFILE.NGB:%=-M%)
LINTFLAGS = -b -x
FILEMODE= 0755
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-empty-body
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(LIBSAFD)/% : %
$(INS.file)
diff --git a/usr/src/cmd/loadkeys/Makefile b/usr/src/cmd/loadkeys/Makefile
index 21f1542c4d..e41a5d823b 100644
--- a/usr/src/cmd/loadkeys/Makefile
+++ b/usr/src/cmd/loadkeys/Makefile
@@ -22,10 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/loadkeys/Makefile
-#
PROG= loadkeys dumpkeys
sparc_SUBDIRS= type_4 type_6 type_101
@@ -41,6 +37,11 @@ EXTRA_INSTALL_TARGETS= $($(MACH)_EXTRA_INSTALL_TARGETS)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
.PARALLEL: $(SUBDIRS)
diff --git a/usr/src/cmd/localedef/Makefile b/usr/src/cmd/localedef/Makefile
index 85889634e0..9acfe6dfbf 100644
--- a/usr/src/cmd/localedef/Makefile
+++ b/usr/src/cmd/localedef/Makefile
@@ -27,9 +27,13 @@ HDRS = localedef.h
SRCS = $(OBJS:%.o=%.c)
CPPFLAGS += -I $(SRC)/lib/libc/port/locale
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
LDLIBS += -lgen
LDLIBS += -lavl
YFLAGS = -d -b parser
+
CLEANFILES = $(OBJS) parser.tab.c parser.tab.h
CLEANFILES += \
UTF-8.cm UTF-8.ct \
diff --git a/usr/src/cmd/localedef/ctype.c b/usr/src/cmd/localedef/ctype.c
index b76ff3d41b..996cd963c7 100644
--- a/usr/src/cmd/localedef/ctype.c
+++ b/usr/src/cmd/localedef/ctype.c
@@ -211,6 +211,7 @@ dump_ctype(void)
_FileRuneEntry *ct = NULL;
_FileRuneEntry *lo = NULL;
_FileRuneEntry *up = NULL;
+ wchar_t wc;
(void) memset(&rl, 0, sizeof (rl));
last_ct = NULL;
@@ -223,11 +224,19 @@ dump_ctype(void)
(void) memcpy(rl.magic, _FILE_RUNE_MAGIC_1, 8);
(void) strncpy(rl.encoding, get_wide_encoding(), sizeof (rl.encoding));
- for (ctn = avl_first(&ctypes); ctn; ctn = AVL_NEXT(&ctypes, ctn)) {
+ /*
+ * Initialize the identity map.
+ */
+ for (wc = 0; (unsigned)wc < _CACHED_RUNES; wc++) {
+ rl.maplower[wc] = wc;
+ rl.mapupper[wc] = wc;
+ }
- wchar_t wc = ctn->wc;
+ for (ctn = avl_first(&ctypes); ctn; ctn = AVL_NEXT(&ctypes, ctn)) {
int conflict = 0;
+ wc = ctn->wc;
+
/*
* POSIX requires certain portable characters have
* certain types. Add them if they are missing.
@@ -305,8 +314,10 @@ dump_ctype(void)
*/
if ((unsigned)wc < _CACHED_RUNES) {
rl.runetype[wc] = ctn->ctype;
- rl.maplower[wc] = ctn->tolower ? ctn->tolower : wc;
- rl.mapupper[wc] = ctn->toupper ? ctn->toupper : wc;
+ if (ctn->tolower)
+ rl.maplower[wc] = ctn->tolower;
+ if (ctn->toupper)
+ rl.mapupper[wc] = ctn->toupper;
continue;
}
diff --git a/usr/src/cmd/lockstat/Makefile.com b/usr/src/cmd/lockstat/Makefile.com
index ce70c62218..54ec4d5853 100644
--- a/usr/src/cmd/lockstat/Makefile.com
+++ b/usr/src/cmd/lockstat/Makefile.com
@@ -32,6 +32,7 @@ include ../../Makefile.cmd
LDLIBS += -lelf -lkstat -ldtrace
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LINTFLAGS += -xerroff=E_SEC_SPRINTF_UNBOUNDED_COPY
LINTFLAGS64 += -xerroff=E_SEC_SPRINTF_UNBOUNDED_COPY
diff --git a/usr/src/cmd/lofiadm/Makefile b/usr/src/cmd/lofiadm/Makefile
index 66aa669b2f..07d01206a2 100644
--- a/usr/src/cmd/lofiadm/Makefile
+++ b/usr/src/cmd/lofiadm/Makefile
@@ -37,6 +37,9 @@ include ../Makefile.cmd
CPPFLAGS += -I $(SRC)/common/crypto -I $(SRC)/common/lzma
LDLIBS += -ldevinfo -lpkcs11 -lcryptoutil
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
.KEEP_STATE:
diff --git a/usr/src/cmd/logadm/Makefile b/usr/src/cmd/logadm/Makefile
index b997fe6ead..246f7b6ef8 100644
--- a/usr/src/cmd/logadm/Makefile
+++ b/usr/src/cmd/logadm/Makefile
@@ -33,6 +33,9 @@ CONFIGFILE= logadm.conf
include ../Makefile.cmd
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-uninitialized
XGETFLAGS += -a -x logadm.xcl
$(ROOTETC)/$(CONFIGFILE):= FILEMODE= 644
diff --git a/usr/src/cmd/logins/Makefile b/usr/src/cmd/logins/Makefile
index 5fd1f63cc9..d9df94c5b9 100644
--- a/usr/src/cmd/logins/Makefile
+++ b/usr/src/cmd/logins/Makefile
@@ -20,12 +20,8 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1990 by Sun Microsystems, Inc.
#
-# cmd/logins/Makefile
-#
PROG= logins
PKGINFO= pkginfo
@@ -34,6 +30,9 @@ TXTS= $(PKGINFO)
include ../Makefile.cmd
TEXT_DOMAIN= SUNW_OST_ADMIN
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
FILEMODE= 0750
.KEEP_STATE:
diff --git a/usr/src/cmd/look/Makefile b/usr/src/cmd/look/Makefile
index 0b25de3ad0..6ba55dd43b 100644
--- a/usr/src/cmd/look/Makefile
+++ b/usr/src/cmd/look/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -37,6 +35,8 @@ ROOTDATA= $(DATA:%=$(ROOTDATADIR)/%)
#DIRS= $(ROOTLIB) $(ROOTDATADIR)
DIRS= $(ROOTDATADIR)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
FILEMODE= 755
$(ROOTDATADIR)/$(DATA):= FILEMODE=444
diff --git a/usr/src/cmd/ls/Makefile.com b/usr/src/cmd/ls/Makefile.com
index cc3ca0ad81..d16e1ce5a8 100644
--- a/usr/src/cmd/ls/Makefile.com
+++ b/usr/src/cmd/ls/Makefile.com
@@ -35,6 +35,8 @@ include ../../Makefile.cmd
LDLIBS += -lsec -lnvpair -lcmdutils -lcurses
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
$(XPG4) := CFLAGS += -DXPG4
# Include all XPG4 changes in the XPG6 version
diff --git a/usr/src/cmd/luxadm/Makefile b/usr/src/cmd/luxadm/Makefile
index dc58795386..75bb1db5f7 100644
--- a/usr/src/cmd/luxadm/Makefile
+++ b/usr/src/cmd/luxadm/Makefile
@@ -23,8 +23,6 @@
# Use is subject to license terms.
#
-#
-
PROG = luxadm
COBJS = adm.o fchba.o lux_util.o fabric_conf.o
@@ -39,6 +37,11 @@ POFILE = luxadm.po
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-address
+
sparc_LDLIBS = -la5k -lg_fc -ldevid -lkstat -ldevinfo
i386_LDLIBS =
LDLIBS += $($(MACH)_LDLIBS)
diff --git a/usr/src/cmd/lvm/Makefile.lvm b/usr/src/cmd/lvm/Makefile.lvm
index f09bb005d0..8b93647d90 100644
--- a/usr/src/cmd/lvm/Makefile.lvm
+++ b/usr/src/cmd/lvm/Makefile.lvm
@@ -23,8 +23,6 @@
# Copyright 2000-2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# Libraries and utilities go here.
@@ -33,6 +31,13 @@ RPCGENFLAGS = -C -M $(DEFINES)
RPCGENFLAGS_SERVER = $(RPCGENFLAGS) -s circuit_n
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-unused-value
#
# Lint flags we use for volume management.
diff --git a/usr/src/cmd/lvm/metassist/Makefile.env b/usr/src/cmd/lvm/metassist/Makefile.env
index 598e2eba8b..77cc84aaa5 100644
--- a/usr/src/cmd/lvm/metassist/Makefile.env
+++ b/usr/src/cmd/lvm/metassist/Makefile.env
@@ -23,8 +23,10 @@
# Copyright 2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Define DEBUG when running nightly DEBUG build
$(NOT_RELEASE_BUILD) CPPFLAGS += -DDEBUG
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-value
diff --git a/usr/src/cmd/mail/Makefile b/usr/src/cmd/mail/Makefile
index 1767d857be..0bd18f5023 100644
--- a/usr/src/cmd/mail/Makefile
+++ b/usr/src/cmd/mail/Makefile
@@ -19,7 +19,6 @@
# CDDL HEADER END
#
#
-#
# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -71,6 +70,11 @@ EDITPATH= \
-e 's!VAR_MAIL!/var/mail!g' < $? > $@
CPPFLAGS = -DSVR4 -I. $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-extra
LDLIBS += -lmail -lsocket
diff --git a/usr/src/cmd/mailx/Makefile b/usr/src/cmd/mailx/Makefile
index ef3be971b6..5def4e8c67 100644
--- a/usr/src/cmd/mailx/Makefile
+++ b/usr/src/cmd/mailx/Makefile
@@ -62,6 +62,10 @@ $(ROOTMAILXRC) := FILEMODE = 0644
$(ROOTUCBMAILRC) := FILEMODE = 0644
CPPFLAGS= -Ihdr -DUSG -DOPTIM $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-clobbered
LINTFLAGS= -hb
LDLIBS += -lmail
LDFLAGS += $(MAPFILE.NGB:%=-M%)
diff --git a/usr/src/cmd/man/src/Makefile b/usr/src/cmd/man/src/Makefile
index 179e974249..32135e8093 100644
--- a/usr/src/cmd/man/src/Makefile
+++ b/usr/src/cmd/man/src/Makefile
@@ -47,6 +47,10 @@ ROOTLIBPROG = $(LIBPROG:%=$(ROOTLIB)/%)
ROOTLIBSHELL = $(LIBSHELL:%=$(ROOTLIB)/%)
ROOTLNKPROG = $(LNKPROG:%=$(ROOTBIN)/%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+
# for messaging catalog files
POFILE= src.po
POFILES= $(SRCS:%.c=%.po)
diff --git a/usr/src/cmd/mdb/Makefile.kmdb b/usr/src/cmd/mdb/Makefile.kmdb
index 7532739aee..e997e5917f 100644
--- a/usr/src/cmd/mdb/Makefile.kmdb
+++ b/usr/src/cmd/mdb/Makefile.kmdb
@@ -99,6 +99,13 @@ ALLLINTFLAGS = $(LINTFLAGS) \
-xerroff=E_INCONS_VAL_TYPE_DECL2 \
-xerroff=E_INCONS_VAL_TYPE_USED2
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+
MAPFILE = mapfile
MAPFILE_INTERMEDIATE = $(MAPFILE).i
MAPFILE_TEMPLATE = ../../../common/kmdb/mapfile_skel
diff --git a/usr/src/cmd/mdb/Makefile.libstand b/usr/src/cmd/mdb/Makefile.libstand
index d260ff4680..471fea3834 100644
--- a/usr/src/cmd/mdb/Makefile.libstand
+++ b/usr/src/cmd/mdb/Makefile.libstand
@@ -23,8 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
.KEEP_STATE:
.SUFFIXES:
@@ -73,6 +71,8 @@ LINTFLAGS += -n -errtags=yes
CLINTFILES = $(SRCS:%.c=%.ln)
LINTFILES = $(CLINTFILES:%.s=%.ln)
+CERRWARN += -_gcc=-Wno-parentheses
+
LIB = libstand.a
COBJS = $(SRCS:%.c=%.o)
OBJS = $(COBJS:%.s=%.o)
diff --git a/usr/src/cmd/mdb/Makefile.libstandctf b/usr/src/cmd/mdb/Makefile.libstandctf
index 4b9d5a76de..7d4c8fbf0d 100644
--- a/usr/src/cmd/mdb/Makefile.libstandctf
+++ b/usr/src/cmd/mdb/Makefile.libstandctf
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
@@ -59,6 +58,8 @@ LINTFILES = $(OBJS:%.o=%.ln)
LINTFLAGS += -n -errtags=yes
+CERRWARN += -_gcc=-Wno-uninitialized
+
.NO_PARALLEL:
.PARALLEL: $(OBJS)
diff --git a/usr/src/cmd/mdb/Makefile.mdb b/usr/src/cmd/mdb/Makefile.mdb
index 1d87ac199f..f331a43fda 100644
--- a/usr/src/cmd/mdb/Makefile.mdb
+++ b/usr/src/cmd/mdb/Makefile.mdb
@@ -99,6 +99,13 @@ C99LMODE= -Xc99=%all
LDLIBS += -lcurses -lkvm -lproc -lrtld_db -lctf -lumem -ldisasm -lscf
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+
#
# -erroff=E_INCONS_ARG_DECL2 works around a problem where lint gets confused
# about how struct mdb_tgt_gregset is used in mdb_tgt_stack_f() and
diff --git a/usr/src/cmd/mdb/Makefile.mdb_ks b/usr/src/cmd/mdb/Makefile.mdb_ks
index fa3fa546f1..464f89c9a4 100644
--- a/usr/src/cmd/mdb/Makefile.mdb_ks
+++ b/usr/src/cmd/mdb/Makefile.mdb_ks
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# mdb_ks, as used in kmdb, requires some special care and feeding during the
@@ -57,3 +55,4 @@ MAPFILE =
#
kmod/mdb_ks.o := CPPFLAGS += -D_mdb_init=mdb_ks_init -D_mdb_fini=mdb_ks_fini
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c b/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c
index 1b82d15662..804f85aba4 100644
--- a/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c
+++ b/usr/src/cmd/mdb/common/kmdb/kmdb_stubs.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* Stubs for basic system services otherwise unavailable to the debugger.
*/
@@ -33,7 +31,6 @@
#include <unistd.h>
#include <libproc.h>
#include <sys/time.h>
-#include <sys/utsname.h>
#include <kmdb/kmdb_dpi.h>
#include <kmdb/kmdb_promif.h>
@@ -179,12 +176,3 @@ exit(int status)
kmdb_dpi_reboot();
#endif
}
-
-#if defined(__i386) && !defined(__amd64)
-/*ARGSUSED*/
-int
-_nuname(struct utsname *buf)
-{
- return (-1);
-}
-#endif
diff --git a/usr/src/cmd/mdb/common/kmdb/mapfile_skel b/usr/src/cmd/mdb/common/kmdb/mapfile_skel
index 46ea67e874..bbf6767bf3 100644
--- a/usr/src/cmd/mdb/common/kmdb/mapfile_skel
+++ b/usr/src/cmd/mdb/common/kmdb/mapfile_skel
@@ -49,11 +49,6 @@ SYMBOL_SCOPE {
/* There should be only one - ours */
errno; /* variable */
- /* <sys/utsname.h> implictly references this on x86 */
-#if defined(__i386) && !defined(__amd64)
- _nuname;
-#endif
-
mdb_tgt_aread;
mdb_dis_create;
mdb_dis_destroy;
diff --git a/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c b/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c
index bca314efdd..f600e5c9b1 100644
--- a/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c
+++ b/usr/src/cmd/mdb/common/modules/mdb_ds/mdb_ds.c
@@ -24,23 +24,12 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
/*
* MDB developer support module. This module is loaded automatically when the
* proc target is initialized and the target is mdb itself. In the future, we
* should document these facilities in the answerbook to aid module developers.
*/
-/*
- * The mere inclusion of sys/utsname.h causes _uname() and uname() to be
- * defined on Intel, along with an external reference to _nuname(). Since we
- * don't actually use uname (or utsname, for that matter) in this dmod, we'll
- * prevent its inclusion.
- */
-#define _SYS_UTSNAME_H
-struct utsname;
-
#define _MDB
#include <mdb/mdb_modapi.h>
#include <mdb/mdb_frame.h>
diff --git a/usr/src/cmd/mdb/common/modules/zfs/zfs.c b/usr/src/cmd/mdb/common/modules/zfs/zfs.c
index d907a5057a..022f1b9b95 100644
--- a/usr/src/cmd/mdb/common/modules/zfs/zfs.c
+++ b/usr/src/cmd/mdb/common/modules/zfs/zfs.c
@@ -905,7 +905,8 @@ arc_print(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
const char *suffix;
static const char *bytestats[] = {
- "p", "c", "c_min", "c_max", "size", NULL
+ "p", "c", "c_min", "c_max", "size", "duplicate_buffers_size",
+ NULL
};
static const char *extras[] = {
diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile b/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile
index 08cbabf3e1..8d36fb01e5 100644
--- a/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile
+++ b/usr/src/cmd/mdb/i86pc/modules/unix/amd64/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -39,3 +38,8 @@ CPPFLAGS += -DMP -D_MACHDEP
CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile b/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile
index 8121af9b49..ad756f82e9 100644
--- a/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile
+++ b/usr/src/cmd/mdb/i86pc/modules/unix/ia32/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -38,3 +37,8 @@ CPPFLAGS += -DMP -D_MACHDEP
CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile b/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile
index 8a6331ac3d..dd8ea3d585 100644
--- a/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile
+++ b/usr/src/cmd/mdb/i86xpv/modules/unix/amd64/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -43,3 +42,8 @@ CPPFLAGS += -I$(SRC)/uts/common
CPPFLAGS += -I$(SRC)/uts/i86xpv
CPPFLAGS += -I$(SRC)/uts/i86pc
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile b/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile
index 20e40d0faa..fd0ad9ee04 100644
--- a/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile
+++ b/usr/src/cmd/mdb/i86xpv/modules/unix/ia32/Makefile
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -42,3 +41,8 @@ CPPFLAGS += -I$(SRC)/uts/common
CPPFLAGS += -I$(SRC)/uts/i86xpv
CPPFLAGS += -I$(SRC)/uts/i86pc
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/Makefile.libstand b/usr/src/cmd/mdb/intel/Makefile.libstand
index f7c386163d..69abf9db8d 100644
--- a/usr/src/cmd/mdb/intel/Makefile.libstand
+++ b/usr/src/cmd/mdb/intel/Makefile.libstand
@@ -23,12 +23,8 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-SRCS += \
- stat.c \
- uname.c
+SRCS += stat.c
%.o: ../../libstand/%.c
$(COMPILE.c) $<
diff --git a/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb b/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb
index 324572a024..278724bb74 100644
--- a/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb
+++ b/usr/src/cmd/mdb/intel/amd64/Makefile.kmdb
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
KMDBML += \
kaif_invoke.s \
@@ -31,6 +29,15 @@ KMDBML += \
KMDBSRCS += \
kmdb_makecontext.c \
- mdb_amd64util.c
+ mdb_amd64util.c \
+ saveargs.c
+
+%.o: $(SRC)/common/saveargs/%.c
+ $(COMPILE.c) $<
+ $(CTFCONVERT_O)
+
+%.ln: $(SRC)/common/saveargs/%.c
+ $(LINT.c) -c $<
SACPPFLAGS = -D__$(MACH64) -U__$(MACH)
+CPPFLAGS += -I$(SRC)/common/saveargs
diff --git a/usr/src/cmd/mdb/intel/amd64/fcip/Makefile b/usr/src/cmd/mdb/intel/amd64/fcip/Makefile
index 7ba9baa3b6..4621e40161 100644
--- a/usr/src/cmd/mdb/intel/amd64/fcip/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/fcip/Makefile
@@ -36,3 +36,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
LINTFLAGS64 += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/intel/amd64/fctl/Makefile b/usr/src/cmd/mdb/intel/amd64/fctl/Makefile
index 2aa2cfaafa..155470c49f 100644
--- a/usr/src/cmd/mdb/intel/amd64/fctl/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/fctl/Makefile
@@ -42,4 +42,8 @@ LINTFLAGS64 += -erroff=E_FUNC_SET_NOT_USED
LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED
LINTFLAGS64 += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
# if optimization is on, compiler asserts
-COPTFLAG64 = -v
+COPTFLAG64 = $(CCVERBOSE)
+
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/amd64/genunix/Makefile b/usr/src/cmd/mdb/intel/amd64/genunix/Makefile
index 02b6ae84a8..fb372b267b 100644
--- a/usr/src/cmd/mdb/intel/amd64/genunix/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/genunix/Makefile
@@ -24,7 +24,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = genunix.so
MDBTGT = kvm
@@ -67,3 +66,9 @@ CPPFLAGS += -I$(SRC)/uts/common
# Needed to find include file mutex_impl.h
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/intel/amd64/idm/Makefile b/usr/src/cmd/mdb/intel/amd64/idm/Makefile
index 063dbb4145..c68aa1c1dc 100644
--- a/usr/src/cmd/mdb/intel/amd64/idm/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/idm/Makefile
@@ -1,3 +1,4 @@
+
#
# CDDL HEADER START
#
@@ -39,3 +40,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(ISCSITBASE)
CPPFLAGS += -I$(ISCSIBASE)
CPPFLAGS += -I$(ISERBASE)
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/amd64/ipc/Makefile b/usr/src/cmd/mdb/intel/amd64/ipc/Makefile
index a0cab76c18..4c77f4bec7 100644
--- a/usr/src/cmd/mdb/intel/amd64/ipc/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/ipc/Makefile
@@ -23,7 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipc.so
MDBTGT = kvm
@@ -34,3 +33,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.amd64
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/amd64/ipp/Makefile b/usr/src/cmd/mdb/intel/amd64/ipp/Makefile
index 6ed321bf73..da6e6cfea0 100644
--- a/usr/src/cmd/mdb/intel/amd64/ipp/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/ipp/Makefile
@@ -23,7 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipp.so
MDBTGT = kvm
@@ -34,3 +33,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.amd64
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/amd64/libproc/Makefile b/usr/src/cmd/mdb/intel/amd64/libproc/Makefile
index 4e98e2dee4..64e67e2d0d 100644
--- a/usr/src/cmd/mdb/intel/amd64/libproc/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/libproc/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libproc.so
MDBTGT = proc
@@ -39,6 +38,8 @@ include ../../../Makefile.module
CFLAGS64 += -I../../../../../lib/libproc/common
LINTFLAGS64 += -I../../../../../lib/libproc/common
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile b/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile
index f669c27ae7..1f33d61aa3 100644
--- a/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/libtopo/Makefile
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libtopo.so
MDBTGT = proc
@@ -36,3 +35,4 @@ include ../../Makefile.amd64
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
index b1b38c5a2a..ae22217a1b 100644
--- a/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/libumem/Makefile
@@ -51,6 +51,10 @@ include ../../../Makefile.module
dmod/$(MODULE) := LDLIBS += -lproc -lm
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile b/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile
index d2a5a8c2a6..fa059da58b 100644
--- a/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/libzpool/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libzpool.so
MDBTGT = proc
@@ -44,6 +43,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-type-limits
+
dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/amd64/mdb/Makefile b/usr/src/cmd/mdb/intel/amd64/mdb/Makefile
index 2115a928e7..6542718c6b 100644
--- a/usr/src/cmd/mdb/intel/amd64/mdb/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/mdb/Makefile
@@ -22,12 +22,12 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
SRCS = kvm_amd64dep.c \
kvm_isadep.c \
mdb_amd64util.c \
- proc_amd64dep.c
+ proc_amd64dep.c \
+ saveargs.c
%.o: %.c
$(COMPILE.c) $<
@@ -37,17 +37,25 @@ SRCS = kvm_amd64dep.c \
$(COMPILE.c) $<
$(CTFCONVERT_O)
+%.o: $(SRC)/common/saveargs/%.c
+ $(COMPILE.c) $<
+ $(CTFCONVERT_O)
+
%.ln: %.c
$(LINT.c) -c $<
%.ln: ../../mdb/%.c
$(LINT.c) -c $<
+%.ln: $(SRC)/common/saveargs/%.c
+ $(LINT.c) -c $<
+
include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.amd64
include ../../../Makefile.mdb
CPPFLAGS += -I../../mdb
+CPPFLAGS += -I$(SRC)/common/saveargs
install: all $(ISAEXEC) $(ROOTPROG64) $(ROOTLINK64)
diff --git a/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile b/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile
index 2a751d4ebf..3b87bba4f0 100644
--- a/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/mpt_sas/Makefile
@@ -33,3 +33,5 @@ include ../../Makefile.amd64
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile b/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile
index e016f01a1d..a8e6e2cfcc 100644
--- a/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/pmcs/Makefile
@@ -36,3 +36,7 @@ include $(SRC)/cmd/mdb/Makefile.module
C99MODE = -xc99=%all
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/amd64/qlc/Makefile b/usr/src/cmd/mdb/intel/amd64/qlc/Makefile
index 7e82d4699b..5c60dfe50b 100644
--- a/usr/src/cmd/mdb/intel/amd64/qlc/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/qlc/Makefile
@@ -44,3 +44,4 @@ LINTFLAGS64 += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-address
diff --git a/usr/src/cmd/mdb/intel/amd64/rdc/Makefile b/usr/src/cmd/mdb/intel/amd64/rdc/Makefile
index 7ceb0798e4..e9dd4a514c 100644
--- a/usr/src/cmd/mdb/intel/amd64/rdc/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/rdc/Makefile
@@ -34,3 +34,5 @@ include ../../Makefile.amd64
include ../../../Makefile.module
include ../../../common/modules/rdc/Makefile.com
CPPFLAGS += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/intel/amd64/ufs/Makefile b/usr/src/cmd/mdb/intel/amd64/ufs/Makefile
index ca03049662..376308fcf3 100644
--- a/usr/src/cmd/mdb/intel/amd64/ufs/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/ufs/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ufs.so
MDBTGT = kvm
@@ -33,3 +32,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.amd64
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/intel/amd64/zfs/Makefile b/usr/src/cmd/mdb/intel/amd64/zfs/Makefile
index 972d59937e..97a4a859c9 100644
--- a/usr/src/cmd/mdb/intel/amd64/zfs/Makefile
+++ b/usr/src/cmd/mdb/intel/amd64/zfs/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = zfs.so
MDBTGT = kvm
@@ -39,3 +38,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/intel/ia32/fcip/Makefile b/usr/src/cmd/mdb/intel/ia32/fcip/Makefile
index 53f235a417..2fdfd5e872 100644
--- a/usr/src/cmd/mdb/intel/ia32/fcip/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/fcip/Makefile
@@ -35,3 +35,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
LINTFLAGS += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/intel/ia32/fctl/Makefile b/usr/src/cmd/mdb/intel/ia32/fctl/Makefile
index 9b15adf814..a784d92918 100644
--- a/usr/src/cmd/mdb/intel/ia32/fctl/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/fctl/Makefile
@@ -41,4 +41,8 @@ LINTFLAGS += -erroff=E_FUNC_SET_NOT_USED
LINTFLAGS += -erroff=E_FUNC_ARG_UNUSED
LINTFLAGS += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
# if optimization is on, compiler asserts
-COPTFLAG = -v
+COPTFLAG = $(CCVERBOSE)
+
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/ia32/genunix/Makefile b/usr/src/cmd/mdb/intel/ia32/genunix/Makefile
index bb50d0bed8..e5efcd19ac 100644
--- a/usr/src/cmd/mdb/intel/ia32/genunix/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/genunix/Makefile
@@ -18,13 +18,10 @@
#
# CDDL HEADER END
-
-#
#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = genunix.so
MDBTGT = kvm
@@ -66,3 +63,9 @@ CPPFLAGS += -I$(SRC)/uts/common
# Needed to find include file mutex_impl.h
CPPFLAGS += -I$(SRC)/uts/intel
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/intel/ia32/idm/Makefile b/usr/src/cmd/mdb/intel/ia32/idm/Makefile
index f6aab4d791..3b43e3170b 100644
--- a/usr/src/cmd/mdb/intel/ia32/idm/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/idm/Makefile
@@ -38,3 +38,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(ISCSITBASE)
CPPFLAGS += -I$(ISCSIBASE)
CPPFLAGS += -I$(ISERBASE)
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/ia32/ipc/Makefile b/usr/src/cmd/mdb/intel/ia32/ipc/Makefile
index 2dd41475da..b2a5bcedfa 100644
--- a/usr/src/cmd/mdb/intel/ia32/ipc/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/ipc/Makefile
@@ -23,7 +23,6 @@
# Copyright (c) 1999 by Sun Microsystems, Inc.
# All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipc.so
MDBTGT = kvm
@@ -33,3 +32,5 @@ MODSRCS = ipc.c
include ../../../../Makefile.cmd
include ../../Makefile.ia32
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/ia32/ipp/Makefile b/usr/src/cmd/mdb/intel/ia32/ipp/Makefile
index 3b01f7ce7e..4905c5df0c 100644
--- a/usr/src/cmd/mdb/intel/ia32/ipp/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/ipp/Makefile
@@ -23,7 +23,6 @@
# Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipp.so
MDBTGT = kvm
@@ -33,3 +32,5 @@ MODSRCS = ipp.c
include ../../../../Makefile.cmd
include ../../Makefile.ia32
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/ia32/libproc/Makefile b/usr/src/cmd/mdb/intel/ia32/libproc/Makefile
index 938998447c..08d6644a93 100644
--- a/usr/src/cmd/mdb/intel/ia32/libproc/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/libproc/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libproc.so
MDBTGT = proc
@@ -38,6 +37,8 @@ include ../../../Makefile.module
CFLAGS += -I../../../../../lib/libproc/common
LINTFLAGS += -I../../../../../lib/libproc/common
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile b/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile
index f7563492bb..364b30392d 100644
--- a/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/libtopo/Makefile
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libtopo.so
MDBTGT = proc
@@ -35,3 +34,4 @@ include ../../Makefile.ia32
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
index 1a1f23446c..bde1be90ac 100644
--- a/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/libumem/Makefile
@@ -50,6 +50,10 @@ include ../../../Makefile.module
dmod/$(MODULE) := LDLIBS += -lproc -lm
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile b/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile
index c8e8b4bb34..bb2758e83b 100644
--- a/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/libzpool/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libzpool.so
MDBTGT = proc
@@ -43,6 +42,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-type-limits
+
dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile b/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile
index 0c277eef7a..7a03980d61 100644
--- a/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/mpt_sas/Makefile
@@ -33,3 +33,5 @@ include ../../Makefile.ia32
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile b/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile
index f68f0e6f9e..63375fbb5a 100644
--- a/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/pmcs/Makefile
@@ -35,3 +35,7 @@ include $(SRC)/cmd/mdb/Makefile.module
C99MODE = -xc99=%all
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/ia32/qlc/Makefile b/usr/src/cmd/mdb/intel/ia32/qlc/Makefile
index c9ce97dbfe..7c015a5ec3 100644
--- a/usr/src/cmd/mdb/intel/ia32/qlc/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/qlc/Makefile
@@ -43,3 +43,4 @@ LINTFLAGS += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-address
diff --git a/usr/src/cmd/mdb/intel/ia32/rdc/Makefile b/usr/src/cmd/mdb/intel/ia32/rdc/Makefile
index 30a242b3e2..63d95aefb3 100644
--- a/usr/src/cmd/mdb/intel/ia32/rdc/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/rdc/Makefile
@@ -33,3 +33,5 @@ include ../../Makefile.ia32
include ../../../Makefile.module
include ../../../common/modules/rdc/Makefile.com
CPPFLAGS += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/intel/ia32/ufs/Makefile b/usr/src/cmd/mdb/intel/ia32/ufs/Makefile
index 212a14d9d4..ebc0c99046 100644
--- a/usr/src/cmd/mdb/intel/ia32/ufs/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/ufs/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ufs.so
MDBTGT = kvm
@@ -32,3 +31,5 @@ MODSRCS = ufs.c ufs_log.c
include ../../../../Makefile.cmd
include ../../Makefile.ia32
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/intel/ia32/zfs/Makefile b/usr/src/cmd/mdb/intel/ia32/zfs/Makefile
index a569d4fd91..8220aa4947 100644
--- a/usr/src/cmd/mdb/intel/ia32/zfs/Makefile
+++ b/usr/src/cmd/mdb/intel/ia32/zfs/Makefile
@@ -23,8 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
MODULE = zfs.so
MDBTGT = kvm
@@ -39,3 +37,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/intel/libstand/uname.c b/usr/src/cmd/mdb/intel/libstand/uname.c
deleted file mode 100644
index f6647df922..0000000000
--- a/usr/src/cmd/mdb/intel/libstand/uname.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License"). You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident "%Z%%M% %I% %E% SMI"
-
-/*
- * The inclusion of <sys/utsname.h> in a source file causes an automatic
- * inclusion of a static definition of uname() that calls _nuname().
- */
-
-#include <sys/utsname.h>
-#include <errno.h>
-
-/*ARGSUSED*/
-int
-_nuname(struct utsname *utsp)
-{
- return (EINVAL);
-}
diff --git a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
index 868533fe11..65adaf37be 100644
--- a/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
+++ b/usr/src/cmd/mdb/intel/mdb/mdb_amd64util.c
@@ -24,8 +24,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/reg.h>
#include <sys/privregs.h>
@@ -41,6 +39,8 @@
#include <mdb/mdb_err.h>
#include <mdb/mdb.h>
+#include <saveargs.h>
+
/*
* This array is used by the getareg and putareg entry points, and also by our
* register variable discipline.
@@ -138,170 +138,6 @@ mdb_amd64_printregs(const mdb_tgt_gregset_t *gregs)
}
/*
- * Sun Studio 10 patch compiler and gcc 3.4.3 Sun branch implemented a
- * "-save_args" option on amd64. When the option is specified, INTEGER
- * type function arguments passed via registers will be saved on the stack
- * immediately after %rbp, and will not be modified through out the life
- * of the routine.
- *
- * +--------+
- * %rbp --> | %rbp |
- * +--------+
- * -0x8(%rbp) | %rdi |
- * +--------+
- * -0x10(%rbp) | %rsi |
- * +--------+
- * -0x18(%rbp) | %rdx |
- * +--------+
- * -0x20(%rbp) | %rcx |
- * +--------+
- * -0x28(%rbp) | %r8 |
- * +--------+
- * -0x30(%rbp) | %r9 |
- * +--------+
- *
- *
- * For example, for the following function,
- *
- * void
- * foo(int a1, int a2, int a3, int a4, int a5, int a6, int a7)
- * {
- * ...
- * }
- *
- * Disassembled code will look something like the following:
- *
- * pushq %rbp
- * movq %rsp, %rbp
- * subq $imm8, %rsp **
- * movq %rdi, -0x8(%rbp)
- * movq %rsi, -0x10(%rbp)
- * movq %rdx, -0x18(%rbp)
- * movq %rcx, -0x20(%rbp)
- * movq %r8, -0x28(%rbp)
- * movq %r9, -0x30(%rbp)
- * ...
- * or
- * pushq %rbp
- * movq %rsp, %rbp
- * subq $imm8, %rsp **
- * movq %r9, -0x30(%rbp)
- * movq %r8, -0x28(%rbp)
- * movq %rcx, -0x20(%rbp)
- * movq %rdx, -0x18(%rbp)
- * movq %rsi, -0x10(%rbp)
- * movq %rdi, -0x8(%rbp)
- * ...
- *
- * **: The space being reserved is in addition to what the current
- * function prolog already reserves.
- *
- * If there are odd number of arguments to a function, additional space is
- * reserved on the stack to maintain 16-byte alignment. For example,
- *
- * argc == 0: no argument saving.
- * argc == 3: save 3, but space for 4 is reserved
- * argc == 7: save 6.
- */
-
-/*
- * The longest instruction sequence in bytes before all 6 arguments are
- * saved on the stack. This value depends on compiler implementation,
- * therefore it should be examined periodically to guarantee accuracy.
- */
-#define SEQ_LEN 80
-
-/*
- * Size of the instruction sequence arrays. It should correspond to
- * the maximum number of arguments passed via registers.
- */
-#define INSTR_ARRAY_SIZE 6
-
-#define INSTR4(ins, off) \
- (ins[(off)] + (ins[(off) + 1] << 8) + (ins[(off + 2)] << 16) + \
- (ins[(off) + 3] << 24))
-
-/*
- * Sun Studio 10 patch implementation saves %rdi first;
- * GCC 3.4.3 Sun branch implementation saves them in reverse order.
- */
-static const uint32_t save_instr[INSTR_ARRAY_SIZE] = {
- 0xf87d8948, /* movq %rdi, -0x8(%rbp) */
- 0xf0758948, /* movq %rsi, -0x10(%rbp) */
- 0xe8558948, /* movq %rdx, -0x18(%rbp) */
- 0xe04d8948, /* movq %rcx, -0x20(%rbp) */
- 0xd845894c, /* movq %r8, -0x28(%rbp) */
- 0xd04d894c /* movq %r9, -0x30(%rbp) */
-};
-
-static const uint32_t save_fp_instr[] = {
- 0xe5894855, /* pushq %rbp; movq %rsp,%rbp, encoding 1 */
- 0xec8b4855, /* pushq %rbp; movq %rsp,%rbp, encoding 2 */
- 0xe58948cc, /* int $0x3; movq %rsp,%rbp, encoding 1 */
- 0xec8b48cc, /* int $0x3; movq %rsp,%rbp, encoding 2 */
- NULL
-};
-
-/*
- * Look for the above instruction sequences as indicators for register
- * arguments being available on the stack.
- */
-static int
-is_argsaved(mdb_tgt_t *t, uintptr_t fstart, uint64_t size, uint_t argc,
- int start_index)
-{
- uint8_t ins[SEQ_LEN];
- int i, j;
- uint32_t n;
-
- size = MIN(size, SEQ_LEN);
- argc = MIN((start_index + argc), INSTR_ARRAY_SIZE);
-
- if (mdb_tgt_vread(t, ins, size, fstart) != size)
- return (0);
-
- /*
- * Make sure framepointer has been saved.
- */
- n = INSTR4(ins, 0);
- for (i = 0; save_fp_instr[i] != NULL; i++) {
- if (n == save_fp_instr[i])
- break;
- }
-
- if (save_fp_instr[i] == NULL)
- return (0);
-
- /*
- * Compare against Sun Studio implementation
- */
- for (i = 8, j = start_index; i < size - 4; i++) {
- n = INSTR4(ins, i);
-
- if (n == save_instr[j]) {
- i += 3;
- if (++j >= argc)
- return (1);
- }
- }
-
- /*
- * Compare against GCC implementation
- */
- for (i = 8, j = argc - 1; i < size - 4; i++) {
- n = INSTR4(ins, i);
-
- if (n == save_instr[j]) {
- i += 3;
- if (--j < start_index)
- return (1);
- }
- }
-
- return (0);
-}
-
-/*
* We expect all proper Solaris core files to have STACK_ALIGN-aligned stacks.
* Hence the name. However, if the core file resulted from a
* hypervisor-initiated panic, the hypervisor's frames may only be 64-bit
@@ -339,6 +175,8 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp,
uintptr_t lastfp, curpc;
ssize_t size;
+ ssize_t insnsize;
+ uint8_t ins[SAVEARGS_INSN_SEQ_LEN];
GElf_Sym s;
mdb_syminfo_t sip;
@@ -354,6 +192,7 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp,
bcopy(gsp, &gregs, sizeof (gregs));
while (fp != 0) {
+ int args_style = 0;
curpc = pc;
@@ -367,28 +206,75 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp,
NULL, 0, &s, &sip) == 0) &&
(mdb_ctf_func_info(&s, &sip, &mfp) == 0)) {
int return_type = mdb_ctf_type_kind(mfp.mtf_return);
+ mdb_ctf_id_t args_types[5];
+
argc = mfp.mtf_argc;
+
/*
- * If the function returns a structure or union,
- * %rdi contains the address in which to store the
- * return value rather than for an argument.
+ * If the function returns a structure or union
+ * greater than 16 bytes in size %rdi contains the
+ * address in which to store the return value rather
+ * than for an argument.
*/
- if (return_type == CTF_K_STRUCT ||
- return_type == CTF_K_UNION)
+ if ((return_type == CTF_K_STRUCT ||
+ return_type == CTF_K_UNION) &&
+ mdb_ctf_type_size(mfp.mtf_return) > 16)
start_index = 1;
else
start_index = 0;
+
+ /*
+ * If any of the first 5 arguments are a structure
+ * less than 16 bytes in size, it will be passed
+ * spread across two argument registers, and we will
+ * not cope.
+ */
+ if (mdb_ctf_func_args(&mfp, 5, args_types) == CTF_ERR)
+ argc = 0;
+
+ for (i = 0; i < MIN(5, argc); i++) {
+ int t = mdb_ctf_type_kind(args_types[i]);
+
+ if (((t == CTF_K_STRUCT) ||
+ (t == CTF_K_UNION)) &&
+ mdb_ctf_type_size(args_types[i]) <= 16) {
+ argc = 0;
+ break;
+ }
+ }
} else {
argc = 0;
}
- if (argc != 0 && is_argsaved(t, s.st_value, s.st_size,
- argc, start_index)) {
+ /*
+ * The number of instructions to search for argument saving is
+ * limited such that only instructions prior to %pc are
+ * considered such that we never read arguments from a
+ * function where the saving code has not in fact yet
+ * executed.
+ */
+ insnsize = MIN(MIN(s.st_size, SAVEARGS_INSN_SEQ_LEN),
+ pc - s.st_value);
+
+ if (mdb_tgt_vread(t, ins, insnsize, s.st_value) != insnsize)
+ argc = 0;
- /* Upto to 6 arguments are passed via registers */
- reg_argc = MIN(6, mfp.mtf_argc);
+ if ((argc != 0) &&
+ ((args_style = saveargs_has_args(ins, insnsize, argc,
+ start_index)) != SAVEARGS_NO_ARGS)) {
+ /* Up to 6 arguments are passed via registers */
+ reg_argc = MIN((6 - start_index), mfp.mtf_argc);
size = reg_argc * sizeof (long);
+ /*
+ * If Studio pushed a structure return address as an
+ * argument, we need to read one more argument than
+ * actually exists (the addr) to make everything line
+ * up.
+ */
+ if (args_style == SAVEARGS_STRUCT_ARGS)
+ size += sizeof (long);
+
if (mdb_tgt_vread(t, fr_argv, size, (fp - size))
!= size)
return (-1); /* errno has been set for us */
@@ -397,21 +283,25 @@ mdb_amd64_kvm_stack_iter(mdb_tgt_t *t, const mdb_tgt_gregset_t *gsp,
* Arrange the arguments in the right order for
* printing.
*/
- for (i = 0; i < (reg_argc >> 1); i++) {
+ for (i = 0; i < (reg_argc / 2); i++) {
long t = fr_argv[i];
fr_argv[i] = fr_argv[reg_argc - i - 1];
fr_argv[reg_argc - i - 1] = t;
}
- if (argc > 6) {
- size = (argc - 6) * sizeof (long);
- if (mdb_tgt_vread(t, &fr_argv[6], size,
+ if (argc > reg_argc) {
+ size = MIN((argc - reg_argc) * sizeof (long),
+ sizeof (fr_argv) -
+ (reg_argc * sizeof (long)));
+
+ if (mdb_tgt_vread(t, &fr_argv[reg_argc], size,
fp + sizeof (fr)) != size)
return (-1); /* errno has been set */
}
- } else
+ } else {
argc = 0;
+ }
if (got_pc && func(arg, pc, argc, fr_argv, &gregs) != 0)
break;
diff --git a/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile b/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile
index f33fd3d67a..324ea9da32 100644
--- a/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile
+++ b/usr/src/cmd/mdb/intel/modules/amd_opteron/amd64/Makefile
@@ -36,3 +36,5 @@ CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc/cpu
CPPFLAGS += -I$(SRC)/uts/intel
CPPFLAGS += -I$(SRC)/uts/i86pc
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile b/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile
index adacbdc27e..cd8c42adef 100644
--- a/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile
+++ b/usr/src/cmd/mdb/intel/modules/amd_opteron/ia32/Makefile
@@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc/cpu
CPPFLAGS += -I$(SRC)/uts/intel
CPPFLAGS += -I$(SRC)/uts/i86pc
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile b/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile
index 483ed03218..55b43df8fb 100644
--- a/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile
+++ b/usr/src/cmd/mdb/intel/modules/generic_cpu/amd64/Makefile
@@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc/cpu
CPPFLAGS += -I$(SRC)/uts/intel
CPPFLAGS += -I$(SRC)/uts/i86pc
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile b/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile
index 84adb38a5c..ab61ac5b5e 100644
--- a/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile
+++ b/usr/src/cmd/mdb/intel/modules/generic_cpu/ia32/Makefile
@@ -35,3 +35,5 @@ CPPFLAGS += -I../../../../common
CPPFLAGS += -I$(SRC)/uts/i86pc/cpu
CPPFLAGS += -I$(SRC)/uts/intel
CPPFLAGS += -I$(SRC)/uts/i86pc
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sparc/v7/libproc/Makefile b/usr/src/cmd/mdb/sparc/v7/libproc/Makefile
index 6c0562334d..137a96b715 100644
--- a/usr/src/cmd/mdb/sparc/v7/libproc/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libproc/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libproc.so
MDBTGT = proc
@@ -38,6 +37,8 @@ include ../../../Makefile.module
CFLAGS += -I../../../../../lib/libproc/common
LINTFLAGS += -I../../../../../lib/libproc/common
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile b/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile
index 2902d3ab2f..988276028d 100644
--- a/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libtopo/Makefile
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libtopo.so
MDBTGT = proc
@@ -35,3 +34,4 @@ include ../../Makefile.sparcv7
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
index 47072b4380..0488e6739a 100644
--- a/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libumem/Makefile
@@ -50,6 +50,10 @@ include ../../../Makefile.module
dmod/$(MODULE) := LDLIBS += -lproc -lm
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile b/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile
index 501b3ef347..54a2d6f42c 100644
--- a/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile
+++ b/usr/src/cmd/mdb/sparc/v7/libzpool/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libzpool.so
MDBTGT = proc
@@ -43,6 +42,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-type-limits
+
dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v9/fcip/Makefile b/usr/src/cmd/mdb/sparc/v9/fcip/Makefile
index 103ff0b9f4..9d270aa8e6 100644
--- a/usr/src/cmd/mdb/sparc/v9/fcip/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/fcip/Makefile
@@ -36,3 +36,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
LINTFLAGS64 += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/sparc/v9/fctl/Makefile b/usr/src/cmd/mdb/sparc/v9/fctl/Makefile
index 4dd5beb32b..28fd247a1c 100644
--- a/usr/src/cmd/mdb/sparc/v9/fctl/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/fctl/Makefile
@@ -41,3 +41,7 @@ LINTFLAGS64 += -erroff=E_SEC_FORBIDDEN_WARN_CFTIME
LINTFLAGS64 += -erroff=E_FUNC_SET_NOT_USED
LINTFLAGS64 += -erroff=E_FUNC_ARG_UNUSED
LINTFLAGS64 += -erroff=E_SEC_SPRINTF_UNBOUNDED_COPY
+
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/sparc/v9/genunix/Makefile b/usr/src/cmd/mdb/sparc/v9/genunix/Makefile
index e70857198b..bb127fd0e3 100644
--- a/usr/src/cmd/mdb/sparc/v9/genunix/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/genunix/Makefile
@@ -24,7 +24,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = genunix.so
MDBTGT = kvm
@@ -65,3 +64,9 @@ CPPFLAGS += -I$(SRC)/uts/sun4u
CPPFLAGS += -I$(SRC)/uts/common
# Needed to find include file mutex_impl.h
CPPFLAGS += -I$(SRC)/uts/sparc/v9
+
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/sparc/v9/idm/Makefile b/usr/src/cmd/mdb/sparc/v9/idm/Makefile
index 3224132f41..c0d77bb8bb 100644
--- a/usr/src/cmd/mdb/sparc/v9/idm/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/idm/Makefile
@@ -39,3 +39,5 @@ include ../../../Makefile.module
CPPFLAGS += -I$(ISCSITBASE)
CPPFLAGS += -I$(ISCSIBASE)
CPPFLAGS += -I$(ISERBASE)
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sparc/v9/ipc/Makefile b/usr/src/cmd/mdb/sparc/v9/ipc/Makefile
index 0cbd234a1d..bb5ab76ef0 100644
--- a/usr/src/cmd/mdb/sparc/v9/ipc/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/ipc/Makefile
@@ -23,7 +23,6 @@
# Copyright (c) 1999-2000 by Sun Microsystems, Inc.
# All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipc.so
MDBTGT = kvm
@@ -34,3 +33,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.sparcv9
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/sparc/v9/ipp/Makefile b/usr/src/cmd/mdb/sparc/v9/ipp/Makefile
index 8cdbb5ff78..d546ca1f4a 100644
--- a/usr/src/cmd/mdb/sparc/v9/ipp/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/ipp/Makefile
@@ -23,7 +23,6 @@
# Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ipp.so
MDBTGT = kvm
@@ -34,3 +33,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.sparcv9
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sparc/v9/libproc/Makefile b/usr/src/cmd/mdb/sparc/v9/libproc/Makefile
index 77fd8f45ba..8dbdc151d4 100644
--- a/usr/src/cmd/mdb/sparc/v9/libproc/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libproc/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libproc.so
MDBTGT = proc
@@ -39,6 +38,8 @@ include ../../../Makefile.module
CFLAGS64 += -I../../../../../lib/libproc/common
LINTFLAGS64 += -I../../../../../lib/libproc/common
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile b/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile
index 19a1294bcd..b0adeeeae2 100644
--- a/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libtopo/Makefile
@@ -23,7 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libtopo.so
MDBTGT = proc
@@ -36,3 +35,4 @@ include ../../Makefile.sparcv9
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/lib/fm/topo/libtopo/common
+CERRWARN += -_gcc=-Wno-parentheses
diff --git a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
index 16d8d80221..87ce977423 100644
--- a/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libumem/Makefile
@@ -64,6 +64,10 @@ include ../../../Makefile.module
dmod/$(MODULE) := LDLIBS += -lproc -lm
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
%.o: $(MODSRCS_DIR)/%.c
$(COMPILE.c) $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile b/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile
index ddcd3d89bc..d7be9ab133 100644
--- a/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/libzpool/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = libzpool.so
MDBTGT = proc
@@ -44,6 +43,8 @@ CPPFLAGS += -I../../../../../lib/libzpool/common \
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-type-limits
+
dmod/%.o: $(GENUNIX_DIR)/%.c
$(COMPILE.c) -o $@ $<
$(CTFCONVERT_O)
diff --git a/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile b/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile
index 2fb251c727..0dfa0293e4 100644
--- a/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/mpt_sas/Makefile
@@ -33,3 +33,5 @@ include ../../Makefile.sparcv9
include ../../../Makefile.module
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile b/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile
index 27c8563bb2..d282a060e5 100644
--- a/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/pmcs/Makefile
@@ -36,3 +36,7 @@ include $(SRC)/cmd/mdb/Makefile.module
C99MODE = -xc99=%all
CPPFLAGS += -I$(SRC)/uts/common
+
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sparc/v9/qlc/Makefile b/usr/src/cmd/mdb/sparc/v9/qlc/Makefile
index 35f315fcbc..1b5dff0286 100644
--- a/usr/src/cmd/mdb/sparc/v9/qlc/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/qlc/Makefile
@@ -44,3 +44,4 @@ LINTFLAGS64 += -erroff=E_STATIC_UNUSED -erroff=E_FUNC_ARG_UNUSED
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+CERRWARN += -_gcc=-Wno-address
diff --git a/usr/src/cmd/mdb/sparc/v9/rdc/Makefile b/usr/src/cmd/mdb/sparc/v9/rdc/Makefile
index 7c09f45c44..5810ed3fb0 100644
--- a/usr/src/cmd/mdb/sparc/v9/rdc/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/rdc/Makefile
@@ -34,3 +34,5 @@ include ../../Makefile.sparcv9
include ../../../Makefile.module
include ../../../common/modules/rdc/Makefile.com
CPPFLAGS += -erroff=E_STATIC_UNUSED
+
+CERRWARN += -_gcc=-Wno-unused-function
diff --git a/usr/src/cmd/mdb/sparc/v9/ufs/Makefile b/usr/src/cmd/mdb/sparc/v9/ufs/Makefile
index c48e4fc262..af42f8c31d 100644
--- a/usr/src/cmd/mdb/sparc/v9/ufs/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/ufs/Makefile
@@ -22,7 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = ufs.so
MDBTGT = kvm
@@ -33,3 +32,5 @@ include ../../../../Makefile.cmd
include ../../../../Makefile.cmd.64
include ../../Makefile.sparcv9
include ../../../Makefile.module
+
+CERRWARN += -_gcc=-Wno-trigraphs
diff --git a/usr/src/cmd/mdb/sparc/v9/zfs/Makefile b/usr/src/cmd/mdb/sparc/v9/zfs/Makefile
index fd6c408774..aa63a724fb 100644
--- a/usr/src/cmd/mdb/sparc/v9/zfs/Makefile
+++ b/usr/src/cmd/mdb/sparc/v9/zfs/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = zfs.so
MDBTGT = kvm
@@ -39,3 +38,5 @@ CPPFLAGS += -I../../../../../uts/common/fs/zfs
C99MODE= -xc99=%all
C99LMODE= -Xc99=%all
+
+CERRWARN += -_gcc=-Wno-type-limits
diff --git a/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile b/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile
index 33c885ac46..529847d000 100644
--- a/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile
+++ b/usr/src/cmd/mdb/sun4u/modules/unix/v9/Makefile
@@ -23,7 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -42,3 +41,4 @@ CPPFLAGS += -I$(SRC)/uts/sun4
CPPFLAGS += -I$(SRC)/uts/sun4u
CPPFLAGS += -I$(SRC)/uts/sfmmu
CPPFLAGS += -I$(SRC)/uts/sparc/v9
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile b/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile
index c160537311..6dda857ccb 100644
--- a/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile
+++ b/usr/src/cmd/mdb/sun4v/modules/unix/v9/Makefile
@@ -23,7 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
MODULE = unix.so
MDBTGT = kvm
@@ -46,3 +45,4 @@ CPPFLAGS += -I$(SRC)/uts/sun4v
CPPFLAGS += -I$(SRC)/uts/sun4u
CPPFLAGS += -I$(SRC)/uts/sfmmu
CPPFLAGS += -I$(SRC)/uts/sparc/v9
+CERRWARN += -_gcc=-Wno-uninitialized
diff --git a/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile b/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile
index 4450e96109..d22287ce44 100644
--- a/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile
+++ b/usr/src/cmd/mdb/sun4v/v9/kmdb/Makefile
@@ -72,6 +72,7 @@ ASFLAGS += -xarch=v9v -I$(SRC)/uts/sun4 -I$(SRC)/uts/sun4v $(TRAPCOUNT)
ASFLAGS += -Dsun4v
ASFLAGS += -I$(SRC)/cmd/mdb/sparc
ASFLAGS += -I$(SRC)/cmd/mdb/sparc/v9 -I$(SRC)/cmd/mdb/sparc/v9/kmdb
+CERRWARN += -_gcc=-Wno-unused-function
install: all $(ROOTMISC64) kaif.fth
diff --git a/usr/src/cmd/mdb/tools/findfp/Makefile.com b/usr/src/cmd/mdb/tools/findfp/Makefile.com
index 67c6f37e32..1da6562ccb 100644
--- a/usr/src/cmd/mdb/tools/findfp/Makefile.com
+++ b/usr/src/cmd/mdb/tools/findfp/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
.KEEP_STATE:
@@ -46,6 +44,7 @@ include ../../common/Makefile.util
#
CPPFLAGS = -I../../common -I../common
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDFLAGS =
LDLIBS = -lelf
diff --git a/usr/src/cmd/mdb/tools/setdynflag/Makefile.com b/usr/src/cmd/mdb/tools/setdynflag/Makefile.com
index 8d2e569c6c..9db6e62e8a 100644
--- a/usr/src/cmd/mdb/tools/setdynflag/Makefile.com
+++ b/usr/src/cmd/mdb/tools/setdynflag/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
.KEEP_STATE:
@@ -45,6 +43,7 @@ include ../../common/Makefile.util
#
CPPFLAGS = -I../../common
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDFLAGS =
LDLIBS = -lelf
diff --git a/usr/src/cmd/mkdir/Makefile b/usr/src/cmd/mkdir/Makefile
index f78554c906..e01d79efc2 100644
--- a/usr/src/cmd/mkdir/Makefile
+++ b/usr/src/cmd/mkdir/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/mkdir/Makefile
-#
PROG= mkdir
OBJS= $(PROG).o common.o
@@ -35,6 +31,8 @@ SRCS= mkdir.c ../chmod/common.c
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lgen
%.o: ../chmod/%.c
diff --git a/usr/src/cmd/mkfifo/Makefile b/usr/src/cmd/mkfifo/Makefile
index 9133e66eae..c7eb356cf3 100644
--- a/usr/src/cmd/mkfifo/Makefile
+++ b/usr/src/cmd/mkfifo/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/mkfifo/Makefile
-#
PROG= mkfifo
OBJS= $(PROG).o common.o
@@ -35,6 +31,7 @@ SRCS= mkfifo.c ../chmod/common.c
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
%.o: ../chmod/%.c
$(COMPILE.c) -o $@ $<
diff --git a/usr/src/cmd/mkmsgs/Makefile b/usr/src/cmd/mkmsgs/Makefile
index e9b08e6c01..d2ebe036bf 100644
--- a/usr/src/cmd/mkmsgs/Makefile
+++ b/usr/src/cmd/mkmsgs/Makefile
@@ -27,6 +27,8 @@ PROG= mkmsgs
include ../Makefile.cmd
LDLIBS += -lgen
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/mknod/Makefile b/usr/src/cmd/mknod/Makefile
index 2f7f9116c2..cdffd352bd 100644
--- a/usr/src/cmd/mknod/Makefile
+++ b/usr/src/cmd/mknod/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -31,6 +29,7 @@ PROG= mknod
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/mkpwdict/Makefile b/usr/src/cmd/mkpwdict/Makefile
index 791fadf4c2..a85eca0423 100644
--- a/usr/src/cmd/mkpwdict/Makefile
+++ b/usr/src/cmd/mkpwdict/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= mkpwdict
@@ -34,6 +32,8 @@ CFLAGS += -I$(SRC)/lib/pam_modules/authtok_check
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2 -m
LINTFLAGS += -I$(SRC)/lib/pam_modules/authtok_check
+CERRWARN += -_gcc=-Wno-parentheses
+
CRACK_SRCDIR= $(SRC)/lib/pam_modules/authtok_check/
CRACK_OBJS= packer.o packlib.o dict.o stringlib.o
CRACK_SRCS= $(CRACK_OBJS:%.o=$(CRACK_SRCDIR)/%.c)
diff --git a/usr/src/cmd/mktemp/Makefile b/usr/src/cmd/mktemp/Makefile
index 4e9ddcd47b..6113762e0f 100644
--- a/usr/src/cmd/mktemp/Makefile
+++ b/usr/src/cmd/mktemp/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -30,6 +28,8 @@ PROG= mktemp
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/modload/Makefile.com b/usr/src/cmd/modload/Makefile.com
index c2805ae9bc..3fe1c676fd 100644
--- a/usr/src/cmd/modload/Makefile.com
+++ b/usr/src/cmd/modload/Makefile.com
@@ -59,6 +59,8 @@ CLOBBERFILES = $(PROG)
LINT_PROG= $(PROG:%=lint_%.c)
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-parentheses
+
# install specifics
$(ROOTDRVPROG) := FILEMODE = 0555
diff --git a/usr/src/cmd/more/Makefile b/usr/src/cmd/more/Makefile
index f8bf6391f1..9ad39bb247 100644
--- a/usr/src/cmd/more/Makefile
+++ b/usr/src/cmd/more/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -39,6 +37,9 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
$(ROOTLIBDATA) := FILEMODE = 0644
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
.KEEP_STATE:
diff --git a/usr/src/cmd/msgfmt/Makefile b/usr/src/cmd/msgfmt/Makefile
index 0cd1e997b0..63b22a8d50 100644
--- a/usr/src/cmd/msgfmt/Makefile
+++ b/usr/src/cmd/msgfmt/Makefile
@@ -26,8 +26,6 @@
# All Rights Reserved
#
-#ident "%Z%%M% %I% %E% SMI"
-
# cmd/msgfmt/Makefile
include ../Makefile.cmd
@@ -64,6 +62,11 @@ CLOBBERFILES += gmsgfmt_rev
ROOTBINPROG= $(BINPROG:%=$(ROOTBIN)/%)
ROOTLIBPROG= $(LIBPROG:%=$(ROOTLIB)/%)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+
.KEEP_STATE:
.PARALLEL: $(SOBJS) $(GOBJS) $(YOBJS) $(COBJS) $(BOBJS) $(LOBJS) \
diff --git a/usr/src/cmd/mv/Makefile b/usr/src/cmd/mv/Makefile
index 911682845c..2072612ffe 100644
--- a/usr/src/cmd/mv/Makefile
+++ b/usr/src/cmd/mv/Makefile
@@ -18,8 +18,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -42,6 +40,9 @@ clean $(XPG4) := OBJS += values-xpg4.o
CLOBBERFILES += $(CPFILE) $(LNFILE)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
$(XPG4) := CFLAGS += -DXPG4
LINTFLAGS += -DXPG4 -u
XGETFLAGS += -a -x mv.xcl
diff --git a/usr/src/cmd/ndmpadm/Makefile b/usr/src/cmd/ndmpadm/Makefile
index b19efbd625..94f51fce89 100644
--- a/usr/src/cmd/ndmpadm/Makefile
+++ b/usr/src/cmd/ndmpadm/Makefile
@@ -46,6 +46,8 @@ POFILE= ndmpadm.po
LDLIBS += -lndmp
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/ndmpd/Makefile b/usr/src/cmd/ndmpd/Makefile
index 3663a45b08..3cb74257ce 100644
--- a/usr/src/cmd/ndmpd/Makefile
+++ b/usr/src/cmd/ndmpd/Makefile
@@ -65,6 +65,11 @@ LINTFLAGS += -xerroff=E_INCONS_VAL_TYPE_DECL2
# argument used inconsistently
LINTFLAGS += -xerroff=E_INCONS_ARG_USED2
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
LDLIBS += -lsocket -lnsl -lzfs -lsec -lndmp -lmd5 -lnvpair -lumem -lbsm -lgen -lcmdutils -linetutil
OBJS= \
diff --git a/usr/src/cmd/newform/Makefile b/usr/src/cmd/newform/Makefile
index ea2188a8da..56a6c40af3 100644
--- a/usr/src/cmd/newform/Makefile
+++ b/usr/src/cmd/newform/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,8 @@ PROG= newform
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/news/Makefile b/usr/src/cmd/news/Makefile
index 9649f6b17c..214ae487bd 100644
--- a/usr/src/cmd/news/Makefile
+++ b/usr/src/cmd/news/Makefile
@@ -29,6 +29,9 @@ include ../Makefile.cmd
VARNEWSD= $(ROOT)/var/news
DIRS= $(VARNEWSD)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/newtask/Makefile.com b/usr/src/cmd/newtask/Makefile.com
index a358d0d56e..7f2dbf60ee 100644
--- a/usr/src/cmd/newtask/Makefile.com
+++ b/usr/src/cmd/newtask/Makefile.com
@@ -34,6 +34,9 @@ LDLIBS += -lproc -lproject -lsecdb
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
CPPFLAGS += -I..
.KEEP_STATE:
diff --git a/usr/src/cmd/nl/Makefile b/usr/src/cmd/nl/Makefile
index 69eb13dd06..1d68f2308f 100644
--- a/usr/src/cmd/nl/Makefile
+++ b/usr/src/cmd/nl/Makefile
@@ -22,10 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/nl/Makefile
-#
# Message catalog requires no special processing because messages
# only occur in ./nl.c, not in ../expr/compile.c.
@@ -42,6 +38,8 @@ include ../Makefile.cmd
LDLIBS += -lgen
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
$(XPG4):= CPPFLAGS += -DXPG4
MAPFILE.INT = ../expr/mapfile-intf
diff --git a/usr/src/cmd/nlsadmin/Makefile b/usr/src/cmd/nlsadmin/Makefile
index c80378fa23..ce2bc57745 100644
--- a/usr/src/cmd/nlsadmin/Makefile
+++ b/usr/src/cmd/nlsadmin/Makefile
@@ -27,6 +27,9 @@ PROG= nlsadmin
include ../Makefile.cmd
FILEMODE= 0755
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/nscd/Makefile b/usr/src/cmd/nscd/Makefile
index 984028cec4..aa478fa3b0 100644
--- a/usr/src/cmd/nscd/Makefile
+++ b/usr/src/cmd/nscd/Makefile
@@ -58,6 +58,11 @@ LINTFLAGS += -erroff=E_GLOBAL_COULD_BE_STATIC2
LINTFLAGS += -erroff=E_NAME_USED_NOT_DEF2
LINTFLAGS += -erroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
+
# nscd interposes on many symbols, and must export others for its own dlsym()
# use, and dlsym() calls from libc. Itemizing the interfaces within a mapfile
# is error-prone, so establish the whole object as an interposer.
diff --git a/usr/src/cmd/oamuser/group/Makefile b/usr/src/cmd/oamuser/group/Makefile
index c4c39b56f4..438890f14b 100644
--- a/usr/src/cmd/oamuser/group/Makefile
+++ b/usr/src/cmd/oamuser/group/Makefile
@@ -50,6 +50,7 @@ LINTFLAGS= -u
INSSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
CPPFLAGS= -I$(HERE) -I$(LOCAL) $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-type-limits
FILEMODE= 0555
$(GROUPADD) := OBJS = $(ADD_OBJ)
diff --git a/usr/src/cmd/oamuser/lib/Makefile b/usr/src/cmd/oamuser/lib/Makefile
index b431c2f5c8..561cf0a3fd 100644
--- a/usr/src/cmd/oamuser/lib/Makefile
+++ b/usr/src/cmd/oamuser/lib/Makefile
@@ -63,6 +63,9 @@ CLOBBERFILES= $(DATEFILE)
GENERAL= ../inc
CPPFLAGS= -I. -I$(GENERAL) $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-unused-variable
ARFLAGS= cr
AROBJS= `$(LORDER) $(OBJS) | $(TSORT)`
LINTFLAGS= -u
diff --git a/usr/src/cmd/oamuser/user/Makefile b/usr/src/cmd/oamuser/user/Makefile
index 64d1a6ed1f..6d3266c508 100644
--- a/usr/src/cmd/oamuser/user/Makefile
+++ b/usr/src/cmd/oamuser/user/Makefile
@@ -70,6 +70,10 @@ INSSBINPROG= $(SBINPROG:%=$(ROOTUSRSBIN)/%)
INSSKELFILE= $(SKELFILE:%=$(ROOTSKEL)/%)
CPPFLAGS= -I$(HERE) -I$(LOCAL) $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
$(INSSBINPROG) := FILEMODE = 0555
$(INSSYSADMPROG):= FILEMODE = 0500
diff --git a/usr/src/cmd/oawk/Makefile b/usr/src/cmd/oawk/Makefile
index 4ce7950110..1b148cf0de 100644
--- a/usr/src/cmd/oawk/Makefile
+++ b/usr/src/cmd/oawk/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/oawk/Makefile
-#
include ../Makefile.cmd
@@ -67,6 +63,12 @@ CPPFLAGS += -D_FILE_OFFSET_BITS=64
ROOTLINK = $(LINKPROG:%=$(ROOTBIN)/%)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE :
all : $(PROG) $(TXTS)
diff --git a/usr/src/cmd/oplhpd/Makefile b/usr/src/cmd/oplhpd/Makefile
index b512c9f08c..c4772bf3e4 100644
--- a/usr/src/cmd/oplhpd/Makefile
+++ b/usr/src/cmd/oplhpd/Makefile
@@ -45,6 +45,8 @@ ROOTMANIFESTDIR = $(ROOTSVCPLATFORMSUN4U)
CPPFLAGS += -I$(SRC)/uts/sun4u/opl
LDLIBS64 += -lsysevent -lnvpair -lcfgadm -ldevinfo
+CERRWARN += -_gcc=-Wno-unused-variable
+
PSMPROG = $(USR_PSM_LIB64_DIR)/$(PROG)
$(PSMPROG) := FILEMODE = 0755
diff --git a/usr/src/cmd/pack/Makefile b/usr/src/cmd/pack/Makefile
index 365475cb39..b50710d831 100644
--- a/usr/src/cmd/pack/Makefile
+++ b/usr/src/cmd/pack/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -30,6 +28,8 @@ PROG= pack
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
XGETFLAGS += -a -x $(PROG).xcl
CPPFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/usr/src/cmd/parted/Makefile b/usr/src/cmd/parted/Makefile
index 371df7dd71..d3aff3828f 100644
--- a/usr/src/cmd/parted/Makefile
+++ b/usr/src/cmd/parted/Makefile
@@ -30,6 +30,7 @@ include ../Makefile.cmd
C99MODE= $(C99_ENABLE)
CERRWARN += -erroff=E_EXTERN_INLINE_UNDEFINED
CERRWARN += -erroff=E_ARG_INCOMPATIBLE_WITH_ARG
+CERRWARN += -_gcc=-Wno-unused-function
srcdir= .
diff --git a/usr/src/cmd/passmgmt/Makefile b/usr/src/cmd/passmgmt/Makefile
index 397270a03c..f6d9bf3283 100644
--- a/usr/src/cmd/passmgmt/Makefile
+++ b/usr/src/cmd/passmgmt/Makefile
@@ -38,6 +38,9 @@ $(ROOTFILE):= FILEMODE= $(LIBFILEMODE)
.KEEP_STATE:
LDLIBS += -lsecdb -lnsl
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
all: $(PROG) $(TXTS)
diff --git a/usr/src/cmd/passwd/Makefile b/usr/src/cmd/passwd/Makefile
index 561357a16c..d53cad2cd6 100644
--- a/usr/src/cmd/passwd/Makefile
+++ b/usr/src/cmd/passwd/Makefile
@@ -33,6 +33,10 @@ lint := LDLIBS += -lpasswdutil
LDFLAGS += $(ZIGNORE)
LDLIBS += -lbsm -lpam -lnsl
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
FILEMODE = 06555
XGETFLAGS += -a -x $(PROG).xcl
diff --git a/usr/src/cmd/pbind/Makefile.com b/usr/src/cmd/pbind/Makefile.com
index 34d8d9d4ad..13f6fab98a 100644
--- a/usr/src/cmd/pbind/Makefile.com
+++ b/usr/src/cmd/pbind/Makefile.com
@@ -32,6 +32,8 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
LDLIBS += -lproc
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/pcidr/Makefile.com b/usr/src/cmd/pcidr/Makefile.com
index ff0bbce8e6..0e9a25dc2c 100755..100644
--- a/usr/src/cmd/pcidr/Makefile.com
+++ b/usr/src/cmd/pcidr/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
#
# to be included AFTER cmd/Makefile.cmd or lib/Makefile.lib
@@ -48,6 +46,8 @@ ROOTCMDDIR = $(ROOTLIBDIR)
CPPFLAGS += -D_REENTRANT -I$(HDRDIR)
+CERRWARN += -_gcc=-Wno-type-limits
+
# Note that LDFLAGS is NOT used in the build rules for shared objects!
# LDLIBS is limited to -L and -l options; all other options must be added to
# DYNFLAGS for shared objects
diff --git a/usr/src/cmd/pcitool/Makefile.com b/usr/src/cmd/pcitool/Makefile.com
index 6ed6c1fbf8..de7dd7c05b 100644
--- a/usr/src/cmd/pcitool/Makefile.com
+++ b/usr/src/cmd/pcitool/Makefile.com
@@ -31,6 +31,9 @@ UTSBASE = ../../../../src/uts
LDLIBS += -ldevinfo
CFLAGS += -D$(MACH) -I$(UTSBASE)/common
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
LINTFLAGS += -I$(UTSBASE)/common
diff --git a/usr/src/cmd/pg/Makefile b/usr/src/cmd/pg/Makefile
index 12a5835fbb..c5ba757837 100644
--- a/usr/src/cmd/pg/Makefile
+++ b/usr/src/cmd/pg/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -35,6 +33,10 @@ LDLIBS += -lgen -lcurses
XGETFLAGS += -a -x $(PROG).xcl
CPPFLAGS += -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/pgrep/Makefile b/usr/src/cmd/pgrep/Makefile
index e97990cdbb..67993f0ff2 100644
--- a/usr/src/cmd/pgrep/Makefile
+++ b/usr/src/cmd/pgrep/Makefile
@@ -37,6 +37,7 @@ include ../Makefile.cmd
CLOBBERFILES += $(PKILLFILE)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -luutil -lproject -lcontract
POFILE = ppgrep.po
diff --git a/usr/src/cmd/picl/plugins/Makefile.com b/usr/src/cmd/picl/plugins/Makefile.com
index a44481ed52..d56f0ec184 100644
--- a/usr/src/cmd/picl/plugins/Makefile.com
+++ b/usr/src/cmd/picl/plugins/Makefile.com
@@ -29,6 +29,12 @@ MAPFILES =
CPPFLAGS += -I$(SRC)/lib/libpicl -I$(SRC)/lib/libpicltree
CPPFLAGS += -I$(SRC)/cmd/picl/plugins/inc
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
# Some picl plugins have dependencies to which they make no reference. These
# dependencies are expected to be loaded so that their .init's fire and thus
diff --git a/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com b/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com
index bff1d92236..a797ca6ea4 100644
--- a/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com
+++ b/usr/src/cmd/picl/plugins/lib/picld_pluginutil/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libpicld_pluginutil.a
VERS= .1
@@ -54,6 +52,7 @@ POFILE= picld_pluginutil.po
CPPFLAGS += -I.. -I$(SRC)/lib/libpicl -I$(SRC)/lib/libpicltree
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_REENTRANT
DYNFLAGS += $(ZNOLAZYLOAD)
LDLIBS += -L$(SRC)/lib/libpicltree/$(MACH)
diff --git a/usr/src/cmd/plimit/amd64/Makefile b/usr/src/cmd/plimit/amd64/Makefile
index 42450afe68..190969b38f 100644
--- a/usr/src/cmd/plimit/amd64/Makefile
+++ b/usr/src/cmd/plimit/amd64/Makefile
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= plimit
@@ -36,6 +34,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproc
diff --git a/usr/src/cmd/plimit/i386/Makefile b/usr/src/cmd/plimit/i386/Makefile
index bd858110ea..7bfabc3b75 100644
--- a/usr/src/cmd/plimit/i386/Makefile
+++ b/usr/src/cmd/plimit/i386/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/plimit/i386/Makefile
-#
PROG= plimit
@@ -37,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproc
diff --git a/usr/src/cmd/plimit/sparcv9/Makefile b/usr/src/cmd/plimit/sparcv9/Makefile
index 3119a50c4c..e4f39a0931 100644
--- a/usr/src/cmd/plimit/sparcv9/Makefile
+++ b/usr/src/cmd/plimit/sparcv9/Makefile
@@ -35,6 +35,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproc
diff --git a/usr/src/cmd/policykit/Makefile b/usr/src/cmd/policykit/Makefile
index c7fff81ed4..0c91f51fe8 100644
--- a/usr/src/cmd/policykit/Makefile
+++ b/usr/src/cmd/policykit/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = polkit-is-privileged
@@ -39,6 +37,8 @@ CPPFLAGS += $(POLICYKIT_DBUS_CPPFLAGS) $(POLICYKIT_GLIB_CPPFLAGS)
CPPFLAGS += -DPACKAGE_VERSION=\"$(POLICYKIT_VERSION)\"
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-unused-variable
+
ROOTUSRSBINPROG = $(PROG:%=$(ROOTUSRSBIN)/%)
.KEEP_STATE:
diff --git a/usr/src/cmd/pools/Makefile.pools b/usr/src/cmd/pools/Makefile.pools
index 9b8f96eb1e..14c23e64a4 100644
--- a/usr/src/cmd/pools/Makefile.pools
+++ b/usr/src/cmd/pools/Makefile.pools
@@ -23,12 +23,14 @@
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/pools/Makefile.pools
POOLSSRC = $(SRC)/cmd/pools
POOLSCOMMONDIR = $(POOLSSRC)/common
COMMON_OBJS = utils.o
COMMON_SRCS = $(COMMON_OBJS:%.o=$(POOLSCOMMONDIR)/%.c)
+
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
diff --git a/usr/src/cmd/power/Makefile b/usr/src/cmd/power/Makefile
index 3496ab78df..85e903e3ec 100644
--- a/usr/src/cmd/power/Makefile
+++ b/usr/src/cmd/power/Makefile
@@ -90,6 +90,9 @@ $(ROOTUSRSBINSYSIDPM) := FILEMODE= 755
# lint pass one enforcement
#
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-value
.PARALLEL: $(OBJS)
diff --git a/usr/src/cmd/power/powerd.c b/usr/src/cmd/power/powerd.c
index 227e91ac38..2d4a3ae274 100644
--- a/usr/src/cmd/power/powerd.c
+++ b/usr/src/cmd/power/powerd.c
@@ -399,7 +399,6 @@ autos3_monitor(void)
logerror("Unable to open %s: %s", SRN, strerror(errno));
thr_exit((void *) errno);
}
- logerror("Able to open %s", SRN);
/*
* Tell device we want the special sauce
diff --git a/usr/src/cmd/powertop/Makefile.com b/usr/src/cmd/powertop/Makefile.com
index 6c88a6cd03..441cefcbbc 100644
--- a/usr/src/cmd/powertop/Makefile.com
+++ b/usr/src/cmd/powertop/Makefile.com
@@ -41,6 +41,8 @@ include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lcurses -ldtrace -lkstat
FILEMODE = 0555
diff --git a/usr/src/cmd/pr/Makefile b/usr/src/cmd/pr/Makefile
index 8c6b8c8747..802d3170c6 100644
--- a/usr/src/cmd/pr/Makefile
+++ b/usr/src/cmd/pr/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -33,6 +31,8 @@ include ../Makefile.cmd
SED = sed
DCFILE = $(PROG).dc
+CERRWARN += -_gcc=-Wno-parentheses
+
$(XPG4):= CPPFLAGS += -DXPG4
$(POFILE) := XGETFLAGS += -a -x pr.xcl
diff --git a/usr/src/cmd/praudit/Makefile b/usr/src/cmd/praudit/Makefile
index 8fafd8043f..4a1b957841 100644
--- a/usr/src/cmd/praudit/Makefile
+++ b/usr/src/cmd/praudit/Makefile
@@ -42,6 +42,9 @@ XGETFLAGS += -a -x praudit.xcl
CPPFLAGS += -D_PRAUDIT -I$(XLATEDIR)
CPPFLAGS += -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lbsm -lnsl -lpam -ltsol
.KEEP_STATE:
diff --git a/usr/src/cmd/prctl/Makefile.com b/usr/src/cmd/prctl/Makefile.com
index 24df4f70b5..7c57f8f7ac 100644
--- a/usr/src/cmd/prctl/Makefile.com
+++ b/usr/src/cmd/prctl/Makefile.com
@@ -23,10 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/prctl/Makefile.com
-#
PROG= prctl
@@ -37,6 +33,8 @@ SRCS= ../prctl.c ../utils.c
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproc -lproject
diff --git a/usr/src/cmd/priocntl/Makefile b/usr/src/cmd/priocntl/Makefile
index f09a10f50f..526d67098e 100644
--- a/usr/src/cmd/priocntl/Makefile
+++ b/usr/src/cmd/priocntl/Makefile
@@ -35,6 +35,8 @@ SRCS= $(OBJ:%.o=%.c)
include ../Makefile.cmd
LDLIBS += -lcontract
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
CLASSD = $(ROOTLIB)/class
RTD = $(CLASSD)/RT
diff --git a/usr/src/cmd/projects/Makefile b/usr/src/cmd/projects/Makefile
index 19bedca9bb..f61bc033b6 100644
--- a/usr/src/cmd/projects/Makefile
+++ b/usr/src/cmd/projects/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -37,6 +35,7 @@ LDLIBS += -lproject
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
all: $(PROG)
diff --git a/usr/src/cmd/prstat/Makefile.com b/usr/src/cmd/prstat/Makefile.com
index 84aac0d24b..e317483142 100644
--- a/usr/src/cmd/prstat/Makefile.com
+++ b/usr/src/cmd/prstat/Makefile.com
@@ -32,6 +32,7 @@ SRCS = $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lcurses -lproject
LINTFLAGS += -u
LINTFLAGS64 += -u
diff --git a/usr/src/cmd/prtconf/Makefile.com b/usr/src/cmd/prtconf/Makefile.com
index ad0ecde37f..b92d0925aa 100644
--- a/usr/src/cmd/prtconf/Makefile.com
+++ b/usr/src/cmd/prtconf/Makefile.com
@@ -30,7 +30,10 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
-LDLIBS += -ldevinfo -lnvpair -lpcidb
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+LDLIBS += -ldevinfo -lnvpair
FILEMODE= 02555
diff --git a/usr/src/cmd/prtdiag/Makefile.com b/usr/src/cmd/prtdiag/Makefile.com
index 2f5e7b0ac0..ca779165bf 100644
--- a/usr/src/cmd/prtdiag/Makefile.com
+++ b/usr/src/cmd/prtdiag/Makefile.com
@@ -31,6 +31,8 @@ PROG = prtdiag
OBJS = main.o
CLASS = 32
+CERRWARN += -_gcc=-Wno-parentheses
+
FILEMODE = 2755
DIRMODE = 755
diff --git a/usr/src/cmd/prtfru/Makefile b/usr/src/cmd/prtfru/Makefile
index 3a90f7882e..a0e7bd359f 100644
--- a/usr/src/cmd/prtfru/Makefile
+++ b/usr/src/cmd/prtfru/Makefile
@@ -32,6 +32,8 @@ SRCS = $(OBJS:%.o=%.c)
include $(SRC)/cmd/Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
CPPFLAGS += -I$(SRC)/lib/libfru/include \
-I$(SRC)/lib/libfruutils
LINTFLAGS += -u
diff --git a/usr/src/cmd/prtvtoc/Makefile b/usr/src/cmd/prtvtoc/Makefile
index 164efc05c6..59db9914bd 100644
--- a/usr/src/cmd/prtvtoc/Makefile
+++ b/usr/src/cmd/prtvtoc/Makefile
@@ -32,6 +32,9 @@ RELUSRSBIN= ../usr/sbin
ROOTSYMLINK= $(ROOTETC)/$(PROG)
LDLIBS += -ladm -lefi
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/ps/Makefile.com b/usr/src/cmd/ps/Makefile.com
index aa7a2bec45..48e187ef48 100644
--- a/usr/src/cmd/ps/Makefile.com
+++ b/usr/src/cmd/ps/Makefile.com
@@ -34,6 +34,8 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproject
.KEEP_STATE:
diff --git a/usr/src/cmd/psrinfo/Makefile b/usr/src/cmd/psrinfo/Makefile
index 0c0f980612..7786294a6f 100644
--- a/usr/src/cmd/psrinfo/Makefile
+++ b/usr/src/cmd/psrinfo/Makefile
@@ -31,6 +31,7 @@ PROG= psrinfo
include ../Makefile.cmd
LDLIBS += -lkstat
+CERRWARN += -_gcc=-Wno-uninitialized
XGETFLAGS +=
$(PROG).po := CPPFLAGS += -DXGETTEXT
diff --git a/usr/src/cmd/psrset/Makefile.com b/usr/src/cmd/psrset/Makefile.com
index 7420cb5d38..b162a57982 100644
--- a/usr/src/cmd/psrset/Makefile.com
+++ b/usr/src/cmd/psrset/Makefile.com
@@ -32,6 +32,8 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lproc
.KEEP_STATE:
diff --git a/usr/src/cmd/ptools/Makefile.bld b/usr/src/cmd/ptools/Makefile.bld
index d0ab70bc6d..f5b50f5ea1 100644
--- a/usr/src/cmd/ptools/Makefile.bld
+++ b/usr/src/cmd/ptools/Makefile.bld
@@ -54,6 +54,21 @@ LDLIBS_pwdx = -lproc
LDLIBS += $(LDLIBS_$(PROG))
+CERRWARN_plgrp += -_gcc=-Wno-parentheses
+
+CERRWARN_ppriv += -_gcc=-Wno-parentheses
+CERRWARN_ppriv += -_gcc=-Wno-uninitialized
+
+CERRWARN_ptree += -_gcc=-Wno-parentheses
+
+CERRWARN_pstack += -_gcc=-Wno-uninitialized
+CERRWARN_pstack += -_gcc=-Wno-clobbered
+
+CERRWARN_pargs += -_gcc=-Wno-clobbered
+CERRWARN_pargs += -_gcc=-Wno-type-limits
+
+CERRWARN += $(CERRWARN_$(PROG))
+
# pargs depends on ../../common/elfcap components
# pmadvise depends on pmap components
diff --git a/usr/src/cmd/ptools/pfiles/pfiles.c b/usr/src/cmd/ptools/pfiles/pfiles.c
index d752d8e95c..a5cefcbdce 100644
--- a/usr/src/cmd/ptools/pfiles/pfiles.c
+++ b/usr/src/cmd/ptools/pfiles/pfiles.c
@@ -21,6 +21,7 @@
/*
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
*/
#include <stdio.h>
@@ -61,7 +62,7 @@ static int Fflag;
static boolean_t nflag = B_FALSE;
static void intr(int);
-static void dofcntl(struct ps_prochandle *, int, int, int);
+static void dofcntl(struct ps_prochandle *, prfdinfo_t *, int, int);
static void dosocket(struct ps_prochandle *, int);
static void dofifo(struct ps_prochandle *, int);
static void dotli(struct ps_prochandle *, int);
@@ -102,7 +103,7 @@ main(int argc, char **argv)
argv += optind;
if (errflg || argc <= 0) {
- (void) fprintf(stderr, "usage:\t%s [-F] pid ...\n",
+ (void) fprintf(stderr, "usage:\t%s [-F] { pid | core } ...\n",
command);
(void) fprintf(stderr,
" (report open files of each process)\n");
@@ -132,12 +133,35 @@ main(int argc, char **argv)
(void) proc_flushstdio();
+ arg = *argv++;
+
/* get the specified pid and the psinfo struct */
- if ((pid = proc_arg_psinfo(arg = *argv++, PR_ARG_PIDS,
+ if ((pid = proc_arg_psinfo(arg, PR_ARG_PIDS,
&psinfo, &gret)) == -1) {
- (void) fprintf(stderr, "%s: cannot examine %s: %s\n",
- command, arg, Pgrab_error(gret));
- retc++;
+
+ if ((Pr = proc_arg_xgrab(arg, NULL, PR_ARG_CORES,
+ Fflag, &gret, NULL)) == NULL) {
+ (void) fprintf(stderr,
+ "%s: cannot examine %s: %s\n",
+ command, arg, Pgrab_error(gret));
+ retc++;
+ continue;
+ }
+ if (proc_arg_psinfo(arg, PR_ARG_ANY, &psinfo,
+ &gret) < 0) {
+ (void) fprintf(stderr,
+ "%s: cannot examine %s: %s\n",
+ command, arg, Pgrab_error(gret));
+ retc++;
+ Prelease(Pr, 0);
+ continue;
+ }
+ (void) printf("core '%s' of %d:\t%.70s\n",
+ arg, (int)psinfo.pr_pid, psinfo.pr_psargs);
+
+ show_files(Pr);
+ Prelease(Pr, 0);
+
} else if ((Pr = Pgrab(pid, Fflag, &gret)) != NULL) {
if (Pcreate_agent(Pr) == 0) {
proc_unctrl_psinfo(&psinfo);
@@ -190,160 +214,121 @@ intr(int sig)
/* ------ begin specific code ------ */
-static void
-show_files(struct ps_prochandle *Pr)
+static int
+show_file(void *data, prfdinfo_t *info)
{
- DIR *dirp;
- struct dirent *dentp;
- const char *dev;
- char pname[100];
- char fname[PATH_MAX];
- struct stat64 statb;
- struct rlimit rlim;
- pid_t pid;
- int fd;
+ struct ps_prochandle *Pr = data;
+ char unknown[12];
char *s;
- int ret;
-
- if (pr_getrlimit(Pr, RLIMIT_NOFILE, &rlim) == 0) {
- ulong_t nfd = rlim.rlim_cur;
- if (nfd == RLIM_INFINITY)
- (void) printf(
- " Current rlimit: unlimited file descriptors\n");
- else
- (void) printf(
- " Current rlimit: %lu file descriptors\n", nfd);
- }
-
- /* in case we are doing this to ourself */
- pid = (Pr == NULL)? getpid() : Pstatus(Pr)->pr_pid;
-
- (void) sprintf(pname, "/proc/%d/fd", (int)pid);
- if ((dirp = opendir(pname)) == NULL) {
- (void) fprintf(stderr, "%s: cannot open directory %s\n",
- command, pname);
- return;
+ mode_t mode;
+
+ if (interrupt)
+ return (1);
+
+ mode = info->pr_mode;
+
+ switch (mode & S_IFMT) {
+ case S_IFCHR: s = "S_IFCHR"; break;
+ case S_IFBLK: s = "S_IFBLK"; break;
+ case S_IFIFO: s = "S_IFIFO"; break;
+ case S_IFDIR: s = "S_IFDIR"; break;
+ case S_IFREG: s = "S_IFREG"; break;
+ case S_IFLNK: s = "S_IFLNK"; break;
+ case S_IFSOCK: s = "S_IFSOCK"; break;
+ case S_IFDOOR: s = "S_IFDOOR"; break;
+ case S_IFPORT: s = "S_IFPORT"; break;
+ default:
+ s = unknown;
+ (void) sprintf(s, "0x%.4x ", (int)mode & S_IFMT);
+ break;
}
- /* for each open file --- */
- while ((dentp = readdir(dirp)) != NULL && !interrupt) {
- char unknown[12];
- dev_t rdev;
+ (void) printf("%4d: %s mode:0%.3o", info->pr_fd, s,
+ (int)mode & ~S_IFMT);
- /* skip '.' and '..' */
- if (!isdigit(dentp->d_name[0]))
- continue;
+ (void) printf(" dev:%u,%u",
+ (unsigned)info->pr_major, (unsigned)info->pr_minor);
- fd = atoi(dentp->d_name);
- if (pr_fstat64(Pr, fd, &statb) == -1) {
- s = unknown;
- (void) sprintf(s, "%4d", fd);
- perror(s);
- continue;
- }
-
- rdev = NODEV;
- switch (statb.st_mode & S_IFMT) {
- case S_IFCHR: s = "S_IFCHR"; rdev = statb.st_rdev; break;
- case S_IFBLK: s = "S_IFBLK"; rdev = statb.st_rdev; break;
- case S_IFIFO: s = "S_IFIFO"; break;
- case S_IFDIR: s = "S_IFDIR"; break;
- case S_IFREG: s = "S_IFREG"; break;
- case S_IFLNK: s = "S_IFLNK"; break;
- case S_IFSOCK: s = "S_IFSOCK"; break;
- case S_IFDOOR: s = "S_IFDOOR"; break;
- case S_IFPORT: s = "S_IFPORT"; break;
- default:
- s = unknown;
- (void) sprintf(s, "0x%.4x ",
- (int)statb.st_mode & S_IFMT);
- break;
- }
-
- (void) printf("%4d: %s mode:0%.3o", fd, s,
- (int)statb.st_mode & ~S_IFMT);
-
- if (major(statb.st_dev) != (major_t)NODEV &&
- minor(statb.st_dev) != (minor_t)NODEV)
- (void) printf(" dev:%lu,%lu",
- (ulong_t)major(statb.st_dev),
- (ulong_t)minor(statb.st_dev));
- else
- (void) printf(" dev:0x%.8lX", (long)statb.st_dev);
-
- if ((statb.st_mode & S_IFMT) == S_IFPORT) {
- (void) printf(" uid:%d gid:%d",
- (int)statb.st_uid,
- (int)statb.st_gid);
- (void) printf(" size:%lld\n",
- (longlong_t)statb.st_size);
- continue;
- }
-
- (void) printf(" ino:%llu uid:%d gid:%d",
- (u_longlong_t)statb.st_ino,
- (int)statb.st_uid, (int)statb.st_gid);
-
- if (rdev == NODEV)
- (void) printf(" size:%lld\n",
- (longlong_t)statb.st_size);
- else if (major(rdev) != (major_t)NODEV &&
- minor(rdev) != (minor_t)NODEV)
- (void) printf(" rdev:%lu,%lu\n",
- (ulong_t)major(rdev), (ulong_t)minor(rdev));
- else
- (void) printf(" rdev:0x%.8lX\n", (long)rdev);
+ if ((mode & S_IFMT) == S_IFPORT) {
+ (void) printf(" uid:%d gid:%d",
+ (int)info->pr_uid, (int)info->pr_gid);
+ (void) printf(" size:%lld\n", (longlong_t)info->pr_size);
+ return (0);
+ }
- if (!nflag) {
- off_t offset;
+ (void) printf(" ino:%llu uid:%d gid:%d",
+ (u_longlong_t)info->pr_ino, (int)info->pr_uid, (int)info->pr_gid);
- dofcntl(Pr, fd,
- (statb.st_mode & (S_IFMT|S_ENFMT|S_IXGRP))
- == (S_IFREG|S_ENFMT),
- (statb.st_mode & S_IFMT) == S_IFDOOR);
+ if ((info->pr_rmajor == (major_t)NODEV) &&
+ (info->pr_rminor == (minor_t)NODEV))
+ (void) printf(" size:%lld\n", (longlong_t)info->pr_size);
+ else
+ (void) printf(" rdev:%u,%u\n",
+ (unsigned)info->pr_rmajor, (unsigned)info->pr_rminor);
- if ((statb.st_mode & S_IFMT) == S_IFSOCK)
- dosocket(Pr, fd);
- else if ((statb.st_mode & S_IFMT) == S_IFIFO)
- dofifo(Pr, fd);
+ if (!nflag) {
+ dofcntl(Pr, info,
+ (mode & (S_IFMT|S_ENFMT|S_IXGRP)) == (S_IFREG|S_ENFMT),
+ (mode & S_IFMT) == S_IFDOOR);
- (void) sprintf(pname, "/proc/%d/path/%d", (int)pid, fd);
+ if (Pstate(Pr) != PS_DEAD) {
+ char *dev;
- if ((ret = readlink(pname, fname, PATH_MAX - 1)) <= 0)
- continue;
+ if ((mode & S_IFMT) == S_IFSOCK)
+ dosocket(Pr, info->pr_fd);
+ else if ((mode & S_IFMT) == S_IFIFO)
+ dofifo(Pr, info->pr_fd);
- fname[ret] = '\0';
-
- if ((statb.st_mode & S_IFMT) == S_IFCHR &&
- (dev = strrchr(fname, ':')) != NULL) {
+ if ((mode & S_IFMT) == S_IFCHR &&
+ (dev = strrchr(info->pr_path, ':')) != NULL) {
/*
- * There's no elegant way to determine if a
- * character device supports TLI, so we lame
- * out and just check a hardcoded list of
- * known TLI devices.
+ * There's no elegant way to determine
+ * if a character device supports TLI,
+ * so we lame out and just check a
+ * hardcoded list of known TLI devices.
*/
int i;
- const char *tlidevs[] =
- { "tcp", "tcp6", "udp", "udp6", NULL };
+ const char *tlidevs[] = {
+ "tcp", "tcp6", "udp", "udp6", NULL
+ };
dev++; /* skip past the `:' */
for (i = 0; tlidevs[i] != NULL; i++) {
if (strcmp(dev, tlidevs[i]) == 0) {
- dotli(Pr, fd);
+ dotli(Pr, info->pr_fd);
break;
}
}
}
- (void) printf(" %s\n", fname);
+ }
- offset = pr_lseek(Pr, fd, 0, SEEK_CUR);
- if (offset != -1) {
- (void) printf(" offset:%ld\n", offset);
- }
+ if (info->pr_path[0] != '\0')
+ (void) printf(" %s\n", info->pr_path);
+ if (info->pr_offset != -1) {
+ (void) printf(" offset:%lld\n",
+ (long long)info->pr_offset);
}
}
- (void) closedir(dirp);
+ return (0);
+}
+
+static void
+show_files(struct ps_prochandle *Pr)
+{
+ struct rlimit rlim;
+
+ if (pr_getrlimit(Pr, RLIMIT_NOFILE, &rlim) == 0) {
+ ulong_t nfd = rlim.rlim_cur;
+ if (nfd == RLIM_INFINITY)
+ (void) printf(
+ " Current rlimit: unlimited file descriptors\n");
+ else
+ (void) printf(
+ " Current rlimit: %lu file descriptors\n", nfd);
+ }
+
+ (void) Pfdinfo_iter(Pr, show_file, Pr);
}
@@ -371,14 +356,17 @@ getflock(struct ps_prochandle *Pr, int fd, struct flock *flock_native)
/* examine open file with fcntl() */
static void
-dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor)
+dofcntl(struct ps_prochandle *Pr, prfdinfo_t *info, int mandatory, int isdoor)
{
struct flock flock;
int fileflags;
int fdflags;
+ int fd;
+
+ fd = info->pr_fd;
- fileflags = pr_fcntl(Pr, fd, F_GETXFL, 0);
- fdflags = pr_fcntl(Pr, fd, F_GETFD, 0);
+ fileflags = info->pr_fileflags;
+ fdflags = info->pr_fdflags;
if (fileflags != -1 || fdflags != -1) {
(void) printf(" ");
@@ -386,10 +374,10 @@ dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor)
show_fileflags(fileflags);
if (fdflags != -1 && (fdflags & FD_CLOEXEC))
(void) printf(" FD_CLOEXEC");
- if (isdoor)
+ if (isdoor && (Pstate(Pr) != PS_DEAD))
show_door(Pr, fd);
(void) fputc('\n', stdout);
- } else if (isdoor) {
+ } else if (isdoor && (Pstate(Pr) != PS_DEAD)) {
(void) printf(" ");
show_door(Pr, fd);
(void) fputc('\n', stdout);
@@ -401,7 +389,7 @@ dofcntl(struct ps_prochandle *Pr, int fd, int mandatory, int isdoor)
flock.l_len = 0;
flock.l_sysid = 0;
flock.l_pid = 0;
- if (getflock(Pr, fd, &flock) != -1) {
+ if ((Pstate(Pr) != PS_DEAD) && (getflock(Pr, fd, &flock) != -1)) {
if (flock.l_type != F_UNLCK && (flock.l_sysid || flock.l_pid)) {
unsigned long sysid = flock.l_sysid;
diff --git a/usr/src/cmd/raidctl/Makefile b/usr/src/cmd/raidctl/Makefile
index 5096020a81..4f7f648912 100644
--- a/usr/src/cmd/raidctl/Makefile
+++ b/usr/src/cmd/raidctl/Makefile
@@ -30,6 +30,7 @@ include $(SRC)/cmd/Makefile.cmd
LDLIBS += -lraidcfg
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/ramdiskadm/Makefile b/usr/src/cmd/ramdiskadm/Makefile
index 7a9b7c3518..7dae74826e 100644
--- a/usr/src/cmd/ramdiskadm/Makefile
+++ b/usr/src/cmd/ramdiskadm/Makefile
@@ -23,8 +23,6 @@
# Copyright 2002-2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= ramdiskadm
OBJS= main.o utils.o
@@ -34,6 +32,7 @@ POFILES= $(OBJS:%.o=%.po)
include ../Makefile.cmd
LDLIBS += -ldevinfo
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/rcap/Makefile.com b/usr/src/cmd/rcap/Makefile.com
index 69f9575d3f..fa5925f732 100644
--- a/usr/src/cmd/rcap/Makefile.com
+++ b/usr/src/cmd/rcap/Makefile.com
@@ -22,7 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
#
# Definitions for targets shared by some subdirs, which have
@@ -32,6 +31,10 @@
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
%.o: $(COMMON_DIR)/%.c
$(COMPILE.c) $<
%.po: $(COMMON_DIR)/%.c
diff --git a/usr/src/cmd/rcm_daemon/Makefile.com b/usr/src/cmd/rcm_daemon/Makefile.com
index d64a5cbb0b..570da30bb1 100644
--- a/usr/src/cmd/rcm_daemon/Makefile.com
+++ b/usr/src/cmd/rcm_daemon/Makefile.com
@@ -117,6 +117,11 @@ CPPFLAGS += -I..
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
CFLAGS += $(CCVERBOSE) $(C_PICFLAGS)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
MAPFILES = ../common/mapfile-intf $(MAPFILE.NGB)
rcm_daemon := LDFLAGS += $(MAPFILES:%=-M%)
diff --git a/usr/src/cmd/rctladm/Makefile b/usr/src/cmd/rctladm/Makefile
index 2592301166..79348db834 100644
--- a/usr/src/cmd/rctladm/Makefile
+++ b/usr/src/cmd/rctladm/Makefile
@@ -34,6 +34,8 @@ lint := LINTFLAGS = -mx
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
POFILE = rctladm_msg.po
XGETFLAGS = -a
FILEMODE = 0555
diff --git a/usr/src/cmd/refer/Makefile b/usr/src/cmd/refer/Makefile
index 0a838b040b..4adb63a15d 100644
--- a/usr/src/cmd/refer/Makefile
+++ b/usr/src/cmd/refer/Makefile
@@ -23,10 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# Makefile for cmd/refer
-#
include ../Makefile.cmd
@@ -49,6 +45,11 @@ OBJS = addbib.o deliv2.o glue1.o glue2.o glue3.o glue4.o \
POFILES= $(OBJS:%.o=%.po)
POFILE= refer.po
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
addbib.po := XGETFLAGS += -a -x addbib.xcl
diff --git a/usr/src/cmd/regcmp/Makefile b/usr/src/cmd/regcmp/Makefile
index ee7560da69..969a8b6d4b 100644
--- a/usr/src/cmd/regcmp/Makefile
+++ b/usr/src/cmd/regcmp/Makefile
@@ -22,13 +22,13 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= regcmp
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/rexd/Makefile b/usr/src/cmd/rexd/Makefile
index 5817b4add5..986f823620 100644
--- a/usr/src/cmd/rexd/Makefile
+++ b/usr/src/cmd/rexd/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= rpc.rexd on
# where under
@@ -35,6 +33,13 @@ MANIFEST= rex.xml
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-extra
+
ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC)
SRCS= $(PROG:%=%.c)
diff --git a/usr/src/cmd/rm/Makefile b/usr/src/cmd/rm/Makefile
index f4e4e02ce1..02ef64bed8 100644
--- a/usr/src/cmd/rm/Makefile
+++ b/usr/src/cmd/rm/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -35,6 +33,7 @@ SRCS= $(RMOBJ1:%.o=%.c) $(SRC)/common/util/getresponse.c
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
$(XPG4) := CFLAGS += -DXPG4
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -I $(SRC)/common/util
LINTFLAGS += -u
diff --git a/usr/src/cmd/rmdir/Makefile b/usr/src/cmd/rmdir/Makefile
index 78101eb911..4c935458bd 100644
--- a/usr/src/cmd/rmdir/Makefile
+++ b/usr/src/cmd/rmdir/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,6 +30,7 @@ include ../Makefile.cmd
LDLIBS += -lgen
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
XGETFLAGS += -a -x rmdir.xcl
diff --git a/usr/src/cmd/rmformat/Makefile b/usr/src/cmd/rmformat/Makefile
index 70739bcf3b..91634d31fa 100644
--- a/usr/src/cmd/rmformat/Makefile
+++ b/usr/src/cmd/rmformat/Makefile
@@ -23,8 +23,6 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= rmformat
@@ -36,6 +34,8 @@ SRCS= $(OBJS:.o=.c)
LDLIBS += -lsmedia -lvolmgt -ladm -lefi
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += -u
CPPFLAGS += -D_FILE_OFFSET_BITS=64
diff --git a/usr/src/cmd/rmmount/Makefile b/usr/src/cmd/rmmount/Makefile
index a8affe358c..a859d240e7 100644
--- a/usr/src/cmd/rmmount/Makefile
+++ b/usr/src/cmd/rmmount/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = rmmount
LOCAL_OBJS = rmmount.o
@@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal
CPPFLAGS += -I$(SRC)/cmd/rmvolmgr
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/rmvolmgr/Makefile b/usr/src/cmd/rmvolmgr/Makefile
index a4ffac4951..32833c1f55 100644
--- a/usr/src/cmd/rmvolmgr/Makefile
+++ b/usr/src/cmd/rmvolmgr/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = rmvolmgr
OBJS = rmm_common.o rmvolmgr.o vold.o
@@ -44,6 +42,12 @@ CPPFLAGS += $(HAL_DBUS_CPPFLAGS) $(HAL_GLIB_CPPFLAGS)
CPPFLAGS += -I$(ROOT)/usr/include/hal
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
+
ROOTCMDDIR = $(ROOTLIB)
ROOTMANIFESTDIR = $(ROOTSVCSYSTEMFILESYSTEM)
$(ROOTMANIFEST) := FILEMODE = 444
diff --git a/usr/src/cmd/rpcbind/Makefile b/usr/src/cmd/rpcbind/Makefile
index 39e98a9435..1e77d8e12c 100644
--- a/usr/src/cmd/rpcbind/Makefile
+++ b/usr/src/cmd/rpcbind/Makefile
@@ -19,12 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/rpcbind/Makefile
PROG= rpcbind
MANIFEST= bind.xml
@@ -44,6 +41,11 @@ ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC)
CPPFLAGS= -I. -DPORTMAP $(CPPFLAGS.master)
CPPFLAGS += -D_REENTRANT
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
LDLIBS += -lsocket -lnsl -lwrap -lscf
.KEEP_STATE:
diff --git a/usr/src/cmd/rpcgen/Makefile b/usr/src/cmd/rpcgen/Makefile
index b6165a59a8..0d0dd2f82c 100644
--- a/usr/src/cmd/rpcgen/Makefile
+++ b/usr/src/cmd/rpcgen/Makefile
@@ -29,13 +29,16 @@ PROG= rpcgen
OBJS= rpc_clntout.o rpc_cout.o rpc_hout.o rpc_main.o rpc_parse.o \
- rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
+ rpc_scan.o rpc_svcout.o rpc_tblout.o rpc_util.o rpc_sample.o
SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
LDLIBS +=
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-char-subscripts
.KEEP_STATE:
diff --git a/usr/src/cmd/rpcinfo/Makefile b/usr/src/cmd/rpcinfo/Makefile
index 6cac5b8322..57483c153a 100644
--- a/usr/src/cmd/rpcinfo/Makefile
+++ b/usr/src/cmd/rpcinfo/Makefile
@@ -20,11 +20,8 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/rpcinfo/Makefile
PROG= rpcinfo
@@ -34,6 +31,7 @@ include ../Makefile.cmd
CPPFLAGS= -DPORTMAP $(CPPFLAGS.master)
LDLIBS += -lnsl
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/rpcsvc/Makefile b/usr/src/cmd/rpcsvc/Makefile
index 3f56f1cb24..fb78120a07 100644
--- a/usr/src/cmd/rpcsvc/Makefile
+++ b/usr/src/cmd/rpcsvc/Makefile
@@ -59,8 +59,13 @@ include ../Makefile.cmd
ROOTMANIFESTDIR= $(ROOTSVCNETWORKRPC)
CPPFLAGS= -I. $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-unused-function
LDLIBS += -lnsl
-rusers := CFLAGS += -v
+rusers := CFLAGS += $(CCVERBOSE)
$(BINPROG) := LDLIBS += -lrpcsvc
$(RPROG) := LDLIBS += -lrpcsvc
$(SPROG) := LDLIBS += -lrpcsvc
diff --git a/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile b/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile
index 28abf8b2ce..b9e0cb036b 100644
--- a/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile
+++ b/usr/src/cmd/rpcsvc/rpc.bootparamd/Makefile
@@ -23,9 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/rpcsvc/rpc.bootparamd/Makefile
PROG= rpc.bootparamd
MANIFEST= bootparams.xml
@@ -36,6 +33,7 @@ OBJS= bootparam_ip_route.o bootparam_prot_svc.o \
include ../Makefile.rpc
CPPFLAGS= -I. $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-parentheses
CFLAGS += -DSYSV
LDLIBS += -lsocket -lnsl
diff --git a/usr/src/cmd/sa/Makefile b/usr/src/cmd/sa/Makefile
index 39aea59f50..26434ff36c 100644
--- a/usr/src/cmd/sa/Makefile
+++ b/usr/src/cmd/sa/Makefile
@@ -32,6 +32,9 @@ include ../Makefile.cmd
ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
GREP= grep
SADC= sadc
diff --git a/usr/src/cmd/saf/Makefile b/usr/src/cmd/saf/Makefile
index a61b2c8b91..438a9d17b4 100644
--- a/usr/src/cmd/saf/Makefile
+++ b/usr/src/cmd/saf/Makefile
@@ -56,6 +56,11 @@ LDLIBS += -lnsl
LDFLAGS += $(MAPFILE.NGB:%=-M%)
LINTFLAGS += -b -x
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-extra
+
util1.o := CPPFLAGS += -DSAC
util2.o := CPPFLAGS += -USAC
diff --git a/usr/src/cmd/sasinfo/Makefile b/usr/src/cmd/sasinfo/Makefile
index 2f35783729..919b3bcc78 100644
--- a/usr/src/cmd/sasinfo/Makefile
+++ b/usr/src/cmd/sasinfo/Makefile
@@ -45,6 +45,8 @@ POFILES = $(LOCAL_OBJS:%.o=%.po)
LDLIBS += -lSMHBAAPI
+CERRWARN += -_gcc=-Wno-unused-value
+
INCS += -I.
INCS += -I$(SRC)/lib/smhba/common
INCS += -I$(SRC)/lib/hbaapi/common
diff --git a/usr/src/cmd/savecore/Makefile.com b/usr/src/cmd/savecore/Makefile.com
index 591f33395b..2a9e06a0d7 100644
--- a/usr/src/cmd/savecore/Makefile.com
+++ b/usr/src/cmd/savecore/Makefile.com
@@ -32,6 +32,7 @@ C99MODE = $(C99_ENABLE)
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -DBZ_NO_STDIO -I$(SRC)/uts/common
#
diff --git a/usr/src/cmd/scadm/Makefile.com b/usr/src/cmd/scadm/Makefile.com
index 16ec946480..f85d0d8363 100644
--- a/usr/src/cmd/scadm/Makefile.com
+++ b/usr/src/cmd/scadm/Makefile.com
@@ -79,6 +79,9 @@ IFLAGS = -I$(SRCDIR) -I$(USR_PSM_INCL_DIR) \
CPPFLAGS = $(IFLAGS) $(CPPFLAGS.master) -D_SYSCALL32
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+
LINKED_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%)
LINKED_SBIN_DIRS = $(PLATLINKS:%=$(USR_PLAT_DIR)/%/sbin)
diff --git a/usr/src/cmd/script/Makefile b/usr/src/cmd/script/Makefile
index f35f1f2c65..dc777f0841 100644
--- a/usr/src/cmd/script/Makefile
+++ b/usr/src/cmd/script/Makefile
@@ -28,6 +28,8 @@ include ../Makefile.cmd
FILEMODE= 0555
+CERRWARN += -_gcc=-Wno-unused-variable
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/scsi/sestopo/Makefile.com b/usr/src/cmd/scsi/sestopo/Makefile.com
index 8fdbbb6ab5..b3ba07a197 100644
--- a/usr/src/cmd/scsi/sestopo/Makefile.com
+++ b/usr/src/cmd/scsi/sestopo/Makefile.com
@@ -23,7 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
.KEEP_STATE:
.SUFFIXES:
@@ -40,6 +39,7 @@ ROOTPROG = $(ROOTLIBSCSI)/$(PROG)
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
CPPFLAGS += -I. -I../common
CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
+CERRWARN += -_gcc=-Wno-unused-variable
LDLIBS += -L$(ROOT)/usr/lib/scsi -lses -lnvpair
LDFLAGS += -R/usr/lib/scsi
diff --git a/usr/src/cmd/scsi/smp/Makefile.com b/usr/src/cmd/scsi/smp/Makefile.com
index f22f111c9e..919bf46201 100644
--- a/usr/src/cmd/scsi/smp/Makefile.com
+++ b/usr/src/cmd/scsi/smp/Makefile.com
@@ -41,6 +41,8 @@ CFLAGS += $(CTF_FLAGS) $(CCVERBOSE) $(XSTRCONST)
LDLIBS += -L$(ROOT)/usr/lib/scsi -lsmp
LDFLAGS += -R/usr/lib/scsi
+CERRWARN += -_gcc=-Wno-unused-variable
+
all: $(PROG)
$(PROG): $(OBJS)
diff --git a/usr/src/cmd/sdiff/Makefile b/usr/src/cmd/sdiff/Makefile
index 37481aa580..e2a02338db 100644
--- a/usr/src/cmd/sdiff/Makefile
+++ b/usr/src/cmd/sdiff/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,8 @@ PROG= sdiff
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/sendmail/Makefile.cmd b/usr/src/cmd/sendmail/Makefile.cmd
index d633dca0bb..c06ca1f5c2 100644
--- a/usr/src/cmd/sendmail/Makefile.cmd
+++ b/usr/src/cmd/sendmail/Makefile.cmd
@@ -26,4 +26,10 @@
CPPFLAGS.sm= $(CPPFLAGS.master) -DSOLARIS=2$(RELEASE_MINOR)00 \
-D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-empty-body
+CERRWARN += -_gcc=-Wno-unused-variable
DBMDEF= -DNDBM -DNEWDB -DNIS -DUSERDB -DMAP_REGEX -DLDAPMAP
diff --git a/usr/src/cmd/sendmail/libmilter/Makefile.com b/usr/src/cmd/sendmail/libmilter/Makefile.com
index 88729a2e40..d59a896251 100644
--- a/usr/src/cmd/sendmail/libmilter/Makefile.com
+++ b/usr/src/cmd/sendmail/libmilter/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
LIBRARY= libmilter.a
VERS= .1
@@ -50,6 +48,8 @@ ENVDEF= -DMILTER -DNETINET6 -DNOT_SENDMAIL -D_REENTRANT \
-Dsm_snprintf=snprintf
CPPFLAGS= $(INCPATH) $(ENVDEF) $(CPPFLAGS.sm)
+CERRWARN += -_gcc=-Wno-type-limits
+
LIBS= $(DYNLIB) $(LINTLIB)
LDLIBS += -lc -lsocket -lnsl
$(LINTLIB) := SRCS= $(SRCDIR)/$(LINTSRC)
diff --git a/usr/src/cmd/setfacl/Makefile b/usr/src/cmd/setfacl/Makefile
index 2cf8ec236e..9519ffca23 100644
--- a/usr/src/cmd/setfacl/Makefile
+++ b/usr/src/cmd/setfacl/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1993 by Sun Microsystems, Inc.
#
@@ -29,6 +27,10 @@ PROG= setfacl
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += -lsec
.KEEP_STATE:
diff --git a/usr/src/cmd/setuname/Makefile.com b/usr/src/cmd/setuname/Makefile.com
index 463fb49651..f5252a3fb7 100644
--- a/usr/src/cmd/setuname/Makefile.com
+++ b/usr/src/cmd/setuname/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= setuname
OBJS= $(PROG).o
@@ -34,6 +32,8 @@ include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lkvm
CLEANFILES += $(OBJS)
diff --git a/usr/src/cmd/sf880drd/Makefile b/usr/src/cmd/sf880drd/Makefile
index d3604de8b1..a37fdd6da5 100644
--- a/usr/src/cmd/sf880drd/Makefile
+++ b/usr/src/cmd/sf880drd/Makefile
@@ -39,6 +39,11 @@ ROOTMANIFESTDIR = $(ROOTSVCPLATFORMSUN4U)
CPPFLAGS += -I$(ROOT)/usr/platform/sun4u/include
LDLIBS += -lcfgadm
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+
PSMPROG = $(USR_PSM_LIB_DIR)/$(PROG)
$(PSMPROG) := FILEMODE = 0755
diff --git a/usr/src/cmd/sgs/Makefile.com b/usr/src/cmd/sgs/Makefile.com
index 11f2bde809..38f138d24b 100644
--- a/usr/src/cmd/sgs/Makefile.com
+++ b/usr/src/cmd/sgs/Makefile.com
@@ -50,6 +50,10 @@ C99_DISABLE = $(C99_ENABLE)
CFLAGS += $(CCVERBOSE) $(DEBUG) $(XFFLAG)
CFLAGS64 += $(CCVERBOSE) $(DEBUG) $(XFFLAG)
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-value
+
#
# Location of the shared elfcap code
#
diff --git a/usr/src/cmd/sgs/ar/Makefile.com b/usr/src/cmd/sgs/ar/Makefile.com
index 2670d05404..4d00f744a4 100644
--- a/usr/src/cmd/sgs/ar/Makefile.com
+++ b/usr/src/cmd/sgs/ar/Makefile.com
@@ -41,6 +41,7 @@ CPPFLAGS= -I. -I../../include $(CPPFLAGS.master) -I$(ELFCAP)
CFLAGS += $(CCVERBOSE)
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lelf $(CONVLIBDIR) $(CONV_LIB) -lsendfile
LINTFLAGS= -x
LINTFLAGS64= -x
diff --git a/usr/src/cmd/sgs/dump/Makefile.com b/usr/src/cmd/sgs/dump/Makefile.com
index 39891ab6e4..1d90361f73 100644
--- a/usr/src/cmd/sgs/dump/Makefile.com
+++ b/usr/src/cmd/sgs/dump/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= dump
@@ -43,6 +41,8 @@ LLDFLAGS = '$(LDPASS)-R$$ORIGIN/../../lib'
LLDFLAGS64 = '$(LDPASS)-R$$ORIGIN/../../../lib/$(MACH64)'
LDFLAGS += $(LLDFLAGS)
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS += -x
LINTSRCS = $(SRCS)
diff --git a/usr/src/cmd/sgs/elfdump/Makefile.com b/usr/src/cmd/sgs/elfdump/Makefile.com
index 3f43a0c776..6f3fdeedac 100644
--- a/usr/src/cmd/sgs/elfdump/Makefile.com
+++ b/usr/src/cmd/sgs/elfdump/Makefile.com
@@ -58,6 +58,9 @@ LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \
LINTFLAGS += -x
LINTFLAGS64 += -x
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+
BLTDEFS = msg.h
BLTDATA = msg.c
BLTMESG = $(SGSMSGDIR)/elfdump
diff --git a/usr/src/cmd/sgs/elfdump/common/_elfdump.h b/usr/src/cmd/sgs/elfdump/common/_elfdump.h
index b2ce8c8e3e..401b29c2d3 100644
--- a/usr/src/cmd/sgs/elfdump/common/_elfdump.h
+++ b/usr/src/cmd/sgs/elfdump/common/_elfdump.h
@@ -224,7 +224,7 @@ typedef enum {
extern corenote_ret_t corenote(Half, int, Word, const char *, Word);
extern void dump_eh_frame(uchar_t *, size_t, uint64_t, Half e_machine,
- uchar_t *e_ident);
+ uchar_t *e_ident, uint64_t gotaddr);
extern void dump_hex_bytes(const void *, size_t, int, int, int);
extern int fake_shdr_cache32(const char *, int, Elf *, Elf32_Ehdr *,
diff --git a/usr/src/cmd/sgs/elfdump/common/corenote.c b/usr/src/cmd/sgs/elfdump/common/corenote.c
index deeaedb85f..81c293572b 100644
--- a/usr/src/cmd/sgs/elfdump/common/corenote.c
+++ b/usr/src/cmd/sgs/elfdump/common/corenote.c
@@ -23,7 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
#include <stdlib.h>
#include <stdio.h>
@@ -1545,6 +1547,45 @@ dump_prpriv(note_state_t *state, const char *title)
indent_exit(state);
}
+static void
+dump_prfdinfo(note_state_t *state, const char *title)
+{
+ const sl_prfdinfo_layout_t *layout = state->ns_arch->prfdinfo;
+ char buf[1024];
+ uint32_t fileflags, mode;
+
+ indent_enter(state, title, &layout->pr_fd);
+
+ PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_FD), pr_fd);
+ mode = extract_as_word(state, &layout->pr_mode);
+
+ print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_MODE),
+ conv_cnote_filemode(mode, 0, buf, sizeof (buf)));
+
+ PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_UID), pr_uid,
+ MSG_ORIG(MSG_CNOTE_T_PR_GID), pr_gid);
+
+ PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_MAJOR), pr_major,
+ MSG_ORIG(MSG_CNOTE_T_PR_MINOR), pr_minor);
+ PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_RMAJOR), pr_rmajor,
+ MSG_ORIG(MSG_CNOTE_T_PR_RMINOR), pr_rminor);
+
+ PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_INO), pr_ino);
+
+ PRINT_DEC_2UP(MSG_ORIG(MSG_CNOTE_T_PR_SIZE), pr_size,
+ MSG_ORIG(MSG_CNOTE_T_PR_OFFSET), pr_offset);
+
+ fileflags = extract_as_word(state, &layout->pr_fileflags);
+
+ print_str(state, MSG_ORIG(MSG_CNOTE_T_PR_FILEFLAGS),
+ conv_cnote_fileflags(fileflags, 0, buf, sizeof (buf)));
+
+ PRINT_DEC(MSG_ORIG(MSG_CNOTE_T_PR_FDFLAGS), pr_fdflags);
+
+ PRINT_STRBUF(MSG_ORIG(MSG_CNOTE_T_PR_PATH), pr_path);
+
+ indent_exit(state);
+}
/*
* Output information from priv_impl_info_t structure.
@@ -1777,6 +1818,14 @@ corenote(Half mach, int do_swap, Word type,
dbg_print(0, MSG_ORIG(MSG_NOTE_DESC));
dbg_print(0, MSG_ORIG(MSG_FMT_INDENT), safe_str(desc, descsz));
return (CORENOTE_R_OK);
+
+
+ case NT_FDINFO:
+ state.ns_vcol = 22;
+ state.ns_t2col = 41;
+ state.ns_v2col = 54;
+ dump_prfdinfo(&state, MSG_ORIG(MSG_CNOTE_DESC_PRFDINFO_T));
+ return (CORENOTE_R_OK);
}
return (CORENOTE_R_BADTYPE);
diff --git a/usr/src/cmd/sgs/elfdump/common/dwarf.c b/usr/src/cmd/sgs/elfdump/common/dwarf.c
index ae95e09630..d6072f51f5 100644
--- a/usr/src/cmd/sgs/elfdump/common/dwarf.c
+++ b/usr/src/cmd/sgs/elfdump/common/dwarf.c
@@ -49,6 +49,7 @@ typedef struct {
uint64_t ciecalign; /* CIE code align factor */
int64_t ciedalign; /* CIE data align factor */
uint64_t fdeinitloc; /* FDE initial location */
+ uint64_t gotaddr; /* Address of the GOT */
} dump_cfi_state_t;
@@ -301,8 +302,8 @@ dump_cfi(uchar_t *data, uint64_t off, uint64_t *ndx, uint_t len,
case 0x01: /* v2: DW_CFA_set_loc, address */
cur_pc = dwarf_ehe_extract(&data[off], ndx,
- state->cieRflag, state->e_ident,
- state->sh_addr, off + *ndx);
+ state->cieRflag, state->e_ident, B_FALSE,
+ state->sh_addr, off + *ndx, state->gotaddr);
dbg_print(0, MSG_ORIG(MSG_CFA_CFASET), PREFIX,
EC_XWORD(cur_pc));
break;
@@ -465,7 +466,7 @@ dump_cfi(uchar_t *data, uint64_t off, uint64_t *ndx, uint_t len,
void
dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr,
- Half e_machine, uchar_t *e_ident)
+ Half e_machine, uchar_t *e_ident, uint64_t gotaddr)
{
Conv_dwarf_ehe_buf_t dwarf_ehe_buf;
dump_cfi_state_t cfi_state;
@@ -479,6 +480,7 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr,
cfi_state.e_ident = e_ident;
cfi_state.sh_addr = sh_addr;
cfi_state.do_swap = _elf_sys_encoding() != e_ident[EI_DATA];
+ cfi_state.gotaddr = gotaddr;
off = 0;
while (off < datasize) {
@@ -568,8 +570,8 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr,
ndx += 1;
persVal = dwarf_ehe_extract(&data[off],
- &ndx, ciePflag, e_ident,
- sh_addr, off + ndx);
+ &ndx, ciePflag, e_ident, B_FALSE,
+ sh_addr, off + ndx, gotaddr);
dbg_print(0,
MSG_ORIG(MSG_UNW_CIEAXPERS));
dbg_print(0,
@@ -633,11 +635,11 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr,
fdelength, fdecieptr);
cfi_state.fdeinitloc = dwarf_ehe_extract(&data[off],
- &ndx, cfi_state.cieRflag, e_ident,
- sh_addr, off + ndx);
+ &ndx, cfi_state.cieRflag, e_ident, B_FALSE,
+ sh_addr, off + ndx, gotaddr);
fdeaddrrange = dwarf_ehe_extract(&data[off], &ndx,
(cfi_state.cieRflag & ~DW_EH_PE_pcrel),
- e_ident, sh_addr, off + ndx);
+ e_ident, B_FALSE, sh_addr, off + ndx, gotaddr);
dbg_print(0, MSG_ORIG(MSG_UNW_FDEINITLOC),
EC_XWORD(cfi_state.fdeinitloc),
@@ -660,7 +662,8 @@ dump_eh_frame(uchar_t *data, size_t datasize, uint64_t sh_addr,
lsda = dwarf_ehe_extract(&data[off],
&lndx, cieLflag, e_ident,
- sh_addr, off + lndx);
+ B_FALSE, sh_addr, off + lndx,
+ gotaddr);
dbg_print(0,
MSG_ORIG(MSG_UNW_FDEAXLSDA),
EC_XWORD(lsda));
diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.c b/usr/src/cmd/sgs/elfdump/common/elfdump.c
index 3eb27cf804..cfd19abc76 100644
--- a/usr/src/cmd/sgs/elfdump/common/elfdump.c
+++ b/usr/src/cmd/sgs/elfdump/common/elfdump.c
@@ -521,6 +521,7 @@ getphdr(Word phnum, Word *type_arr, Word type_cnt, const char *file, Elf *elf)
* entry:
* cache - Cache of all section headers
* shndx - Index of .eh_frame or .eh_frame_hdr section to be displayed
+ * shnum - Total number of sections which exist
* uphdr - NULL, or unwind program header associated with
* the .eh_frame_hdr section.
* ehdr - ELF header for file
@@ -532,7 +533,7 @@ getphdr(Word phnum, Word *type_arr, Word type_cnt, const char *file, Elf *elf)
* flags - Command line option flags
*/
static void
-unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
+unwind_eh_frame(Cache *cache, Word shndx, Word shnum, Phdr *uphdr, Ehdr *ehdr,
gnu_eh_state_t *eh_state, uchar_t osabi, const char *file, uint_t flags)
{
#if defined(_ELF64)
@@ -551,7 +552,16 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
uint64_t ndx, frame_ptr, fde_cnt, tabndx;
uint_t vers, frame_ptr_enc, fde_cnt_enc, table_enc;
uint64_t initloc, initloc0;
+ uint64_t gotaddr = 0;
+ int cnt;
+ for (cnt = 1; cnt < shnum; cnt++) {
+ if (strncmp(cache[cnt].c_name, MSG_ORIG(MSG_ELF_GOT),
+ MSG_ELF_GOT_SIZE) == 0) {
+ gotaddr = cache[cnt].c_shdr->sh_addr;
+ break;
+ }
+ }
/*
* Is this a .eh_frame_hdr?
@@ -578,7 +588,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
dbg_print(0, MSG_ORIG(MSG_UNW_FRMVERS), vers);
frame_ptr = dwarf_ehe_extract(data, &ndx, frame_ptr_enc,
- ehdr->e_ident, shdr->sh_addr, ndx);
+ ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr);
if (eh_state->hdr_cnt == 1) {
eh_state->hdr_ndx = shndx;
eh_state->frame_ptr = frame_ptr;
@@ -589,7 +599,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
EC_XWORD(frame_ptr));
fde_cnt = dwarf_ehe_extract(data, &ndx, fde_cnt_enc,
- ehdr->e_ident, shdr->sh_addr, ndx);
+ ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr);
dbg_print(0, MSG_ORIG(MSG_UNW_FDCNENC),
conv_dwarf_ehe(fde_cnt_enc, &dwarf_ehe_buf),
@@ -601,7 +611,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
for (tabndx = 0; tabndx < fde_cnt; tabndx++) {
initloc = dwarf_ehe_extract(data, &ndx, table_enc,
- ehdr->e_ident, shdr->sh_addr, ndx);
+ ehdr->e_ident, B_TRUE, shdr->sh_addr, ndx, gotaddr);
/*LINTED:E_VAR_USED_BEFORE_SET*/
if ((tabndx != 0) && (initloc0 > initloc))
(void) fprintf(stderr,
@@ -610,8 +620,8 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
dbg_print(0, MSG_ORIG(MSG_UNW_BINSRTABENT),
EC_XWORD(initloc),
EC_XWORD(dwarf_ehe_extract(data, &ndx,
- table_enc, ehdr->e_ident, shdr->sh_addr,
- ndx)));
+ table_enc, ehdr->e_ident, B_TRUE, shdr->sh_addr,
+ ndx, gotaddr)));
initloc0 = initloc;
}
} else { /* Display the .eh_frame section */
@@ -628,7 +638,7 @@ unwind_eh_frame(Cache *cache, Word shndx, Phdr *uphdr, Ehdr *ehdr,
conv_ehdr_type(osabi, ehdr->e_type, 0, &inv_buf));
}
dump_eh_frame(data, datasize, shdr->sh_addr,
- ehdr->e_machine, ehdr->e_ident);
+ ehdr->e_machine, ehdr->e_ident, gotaddr);
}
/*
@@ -875,8 +885,8 @@ unwind(Cache *cache, Word shnum, Word phnum, Ehdr *ehdr, uchar_t osabi,
unwind_exception_ranges(_cache, file,
_elf_sys_encoding() != ehdr->e_ident[EI_DATA]);
else
- unwind_eh_frame(cache, cnt, uphdr, ehdr, &eh_state,
- osabi, file, flags);
+ unwind_eh_frame(cache, cnt, shnum, uphdr, ehdr,
+ &eh_state, osabi, file, flags);
}
}
diff --git a/usr/src/cmd/sgs/elfdump/common/elfdump.msg b/usr/src/cmd/sgs/elfdump/common/elfdump.msg
index aada7e8e9f..62aeab5d73 100644
--- a/usr/src/cmd/sgs/elfdump/common/elfdump.msg
+++ b/usr/src/cmd/sgs/elfdump/common/elfdump.msg
@@ -21,6 +21,7 @@
#
# Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
#
@ _START_
@@ -457,6 +458,7 @@
@ MSG_CNOTE_DESC_PSINFO_T "desc: (psinfo_t)"
@ MSG_CNOTE_DESC_PSTATUS_T "desc: (pstatus_t)"
@ MSG_CNOTE_DESC_STRUCT_UTSNAME "desc: (struct utsname)"
+@ MSG_CNOTE_DESC_PRFDINFO_T "desc: (prfdinfo_t)"
@ MSG_CNOTE_FMT_LINE "%*s%-*s%s"
@@ -615,6 +617,17 @@
@ MSG_CNOTE_T_UTS_RELEASE "release:"
@ MSG_CNOTE_T_UTS_SYSNAME "sysname:"
@ MSG_CNOTE_T_UTS_VERSION "version:"
+@ MSG_CNOTE_T_PR_FD "pr_fd:"
+@ MSG_CNOTE_T_PR_MODE "pr_mode:"
+@ MSG_CNOTE_T_PR_PATH "pr_path:"
+@ MSG_CNOTE_T_PR_MAJOR "pr_major:"
+@ MSG_CNOTE_T_PR_MINOR "pr_minor:"
+@ MSG_CNOTE_T_PR_RMAJOR "pr_rmajor:"
+@ MSG_CNOTE_T_PR_RMINOR "pr_rminor:"
+@ MSG_CNOTE_T_PR_OFFSET "pr_offset:"
+@ MSG_CNOTE_T_PR_INO "pr_ino:"
+@ MSG_CNOTE_T_PR_FILEFLAGS "pr_fileflags:"
+@ MSG_CNOTE_T_PR_FDFLAGS "pr_fdflags:"
# Names of fake sections generated from program header data
diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout.h b/usr/src/cmd/sgs/elfdump/common/struct_layout.h
index 69934f9336..11dbcc4b83 100644
--- a/usr/src/cmd/sgs/elfdump/common/struct_layout.h
+++ b/usr/src/cmd/sgs/elfdump/common/struct_layout.h
@@ -24,6 +24,10 @@
* Use is subject to license terms.
*/
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
+
#ifndef _STRUCT_LAYOUT_H
#define _STRUCT_LAYOUT_H
@@ -88,7 +92,7 @@ typedef struct {
} sl_field_t;
/*
- * This type is used to extract and manipuate data described by
+ * This type is used to extract and manipulate data described by
* sl_field_t. We rely on the C guarantee that all the fields in
* a union have offset 0.
*/
@@ -502,6 +506,27 @@ typedef struct {
} sl_utsname_layout_t;
/*
+ * Layout description of prdinfo_t, from <sys/procfs.h>.
+ */
+typedef struct {
+ sl_field_t sizeof_struct;
+ sl_field_t pr_fd;
+ sl_field_t pr_mode;
+ sl_field_t pr_uid;
+ sl_field_t pr_gid;
+ sl_field_t pr_major;
+ sl_field_t pr_minor;
+ sl_field_t pr_rmajor;
+ sl_field_t pr_rminor;
+ sl_field_t pr_ino;
+ sl_field_t pr_offset;
+ sl_field_t pr_size;
+ sl_field_t pr_fileflags;
+ sl_field_t pr_fdflags;
+ sl_field_t pr_path;
+} sl_prfdinfo_layout_t;
+
+/*
* This type collects all of the layout definitions for
* a given architecture.
*/
@@ -525,6 +550,7 @@ typedef struct {
const sl_sysset_layout_t *sysset; /* sysset_t */
const sl_timestruc_layout_t *timestruc; /* timestruc_t */
const sl_utsname_layout_t *utsname; /* struct utsname */
+ const sl_prfdinfo_layout_t *prfdinfo; /* prdinfo_t */
} sl_arch_layout_t;
diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c
index 9d945be569..e23de0589b 100644
--- a/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c
+++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_amd64.c
@@ -23,7 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
#include <struct_layout.h>
@@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = {
};
+static const sl_prfdinfo_layout_t prfdinfo_layout = {
+ { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */
+ { 0, 4, 0, 0 }, /* pr_fd */
+ { 4, 4, 0, 0 }, /* pr_mode */
+ { 8, 4, 0, 0 }, /* pr_uid */
+ { 12, 4, 0, 0 }, /* pr_gid */
+ { 16, 4, 0, 0 }, /* pr_major */
+ { 20, 4, 0, 0 }, /* pr_minor */
+ { 24, 4, 0, 0 }, /* pr_rmajor */
+ { 28, 4, 0, 0 }, /* pr_rminor */
+ { 32, 8, 0, 0 }, /* pr_ino */
+ { 40, 8, 0, 0 }, /* pr_offset */
+ { 48, 8, 0, 0 }, /* pr_size */
+ { 56, 4, 0, 0 }, /* pr_filefags */
+ { 60, 4, 0, 0 }, /* pr_fdflags */
+ { 64, 1, 1024, 0 }, /* pr_path */
+};
static const sl_arch_layout_t layout_amd64 = {
@@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_amd64 = {
&sysset_layout,
&timestruc_layout,
&utsname_layout,
+ &prfdinfo_layout,
};
diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c
index 0f38abd92b..1273eec8db 100644
--- a/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c
+++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_i386.c
@@ -23,7 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
#include <struct_layout.h>
@@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = {
};
+static const sl_prfdinfo_layout_t prfdinfo_layout = {
+ { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */
+ { 0, 4, 0, 0 }, /* pr_fd */
+ { 4, 4, 0, 0 }, /* pr_mode */
+ { 8, 4, 0, 0 }, /* pr_uid */
+ { 12, 4, 0, 0 }, /* pr_gid */
+ { 16, 4, 0, 0 }, /* pr_major */
+ { 20, 4, 0, 0 }, /* pr_minor */
+ { 24, 4, 0, 0 }, /* pr_rmajor */
+ { 28, 4, 0, 0 }, /* pr_rminor */
+ { 32, 8, 0, 0 }, /* pr_ino */
+ { 40, 8, 0, 0 }, /* pr_offset */
+ { 48, 8, 0, 0 }, /* pr_size */
+ { 56, 4, 0, 0 }, /* pr_filefags */
+ { 60, 4, 0, 0 }, /* pr_fdflags */
+ { 64, 1, 1024, 0 }, /* pr_path */
+};
static const sl_arch_layout_t layout_i386 = {
@@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_i386 = {
&sysset_layout,
&timestruc_layout,
&utsname_layout,
+ &prfdinfo_layout,
};
diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c
index 5cdf63dae4..c1a05a3a63 100644
--- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c
+++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparc.c
@@ -23,8 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
#include <struct_layout.h>
@@ -356,6 +357,23 @@ static const sl_utsname_layout_t utsname_layout = {
};
+static const sl_prfdinfo_layout_t prfdinfo_layout = {
+ { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */
+ { 0, 4, 0, 0 }, /* pr_fd */
+ { 4, 4, 0, 0 }, /* pr_mode */
+ { 8, 4, 0, 0 }, /* pr_uid */
+ { 12, 4, 0, 0 }, /* pr_gid */
+ { 16, 4, 0, 0 }, /* pr_major */
+ { 20, 4, 0, 0 }, /* pr_minor */
+ { 24, 4, 0, 0 }, /* pr_rmajor */
+ { 28, 4, 0, 0 }, /* pr_rminor */
+ { 32, 8, 0, 0 }, /* pr_ino */
+ { 40, 8, 0, 0 }, /* pr_offset */
+ { 48, 8, 0, 0 }, /* pr_size */
+ { 56, 4, 0, 0 }, /* pr_filefags */
+ { 60, 4, 0, 0 }, /* pr_fdflags */
+ { 64, 1, 1024, 0 }, /* pr_path */
+};
static const sl_arch_layout_t layout_sparc = {
@@ -378,6 +396,7 @@ static const sl_arch_layout_t layout_sparc = {
&sysset_layout,
&timestruc_layout,
&utsname_layout,
+ &prfdinfo_layout,
};
diff --git a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c
index c74b45f62a..cf61ab9f81 100644
--- a/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c
+++ b/usr/src/cmd/sgs/elfdump/common/struct_layout_sparcv9.c
@@ -23,7 +23,9 @@
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
#include <struct_layout.h>
@@ -356,6 +358,23 @@ static const sl_utsname_layout_t utsname_layout = {
};
+static const sl_prfdinfo_layout_t prfdinfo_layout = {
+ { 0, 1088, 0, 0 }, /* sizeof (prfdinfo_t) */
+ { 0, 4, 0, 0 }, /* pr_fd */
+ { 4, 4, 0, 0 }, /* pr_mode */
+ { 8, 4, 0, 0 }, /* pr_uid */
+ { 12, 4, 0, 0 }, /* pr_gid */
+ { 16, 4, 0, 0 }, /* pr_major */
+ { 20, 4, 0, 0 }, /* pr_minor */
+ { 24, 4, 0, 0 }, /* pr_rmajor */
+ { 28, 4, 0, 0 }, /* pr_rminor */
+ { 32, 8, 0, 0 }, /* pr_ino */
+ { 40, 8, 0, 0 }, /* pr_offset */
+ { 48, 8, 0, 0 }, /* pr_size */
+ { 56, 4, 0, 0 }, /* pr_filefags */
+ { 60, 4, 0, 0 }, /* pr_fdflags */
+ { 64, 1, 1024, 0 }, /* pr_path */
+};
static const sl_arch_layout_t layout_sparcv9 = {
@@ -378,6 +397,7 @@ static const sl_arch_layout_t layout_sparcv9 = {
&sysset_layout,
&timestruc_layout,
&utsname_layout,
+ &prfdinfo_layout,
};
diff --git a/usr/src/cmd/sgs/elfedit/Makefile.com b/usr/src/cmd/sgs/elfedit/Makefile.com
index 9e86980583..67059f62b0 100644
--- a/usr/src/cmd/sgs/elfedit/Makefile.com
+++ b/usr/src/cmd/sgs/elfedit/Makefile.com
@@ -53,6 +53,9 @@ LDLIBS += $(ELFLIBDIR) -lelf $(LDDBGLIBDIR) $(LDDBG_LIB) \
LINTFLAGS += -x
LINTFLAGS64 += -x
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
BLTDEFS = msg.h
BLTDATA = msg.c
BLTMESG = $(SGSMSGDIR)/elfedit
diff --git a/usr/src/cmd/sgs/elfedit/modules/Makefile.com b/usr/src/cmd/sgs/elfedit/modules/Makefile.com
index 294016f554..226b8a4f13 100644
--- a/usr/src/cmd/sgs/elfedit/modules/Makefile.com
+++ b/usr/src/cmd/sgs/elfedit/modules/Makefile.com
@@ -96,6 +96,9 @@ LLDFLAGS64 = '-R$$ORIGIN/../../../../lib/$(MACH64)'
LDFLAGS += $(CC_USE_PROTO) $(LLDFLAGS)
DYNFLAGS += $(VERSREF)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += -uaxs $(LDLIBS)
LINTFLAGS64 += -uaxs $(LDLIBS64)
diff --git a/usr/src/cmd/sgs/elfwrap/Makefile.com b/usr/src/cmd/sgs/elfwrap/Makefile.com
index 3d0162766e..0236d7a437 100644
--- a/usr/src/cmd/sgs/elfwrap/Makefile.com
+++ b/usr/src/cmd/sgs/elfwrap/Makefile.com
@@ -57,6 +57,8 @@ LDLIBS += $(ELFLIBDIR) -lelf $(CONVLIBDIR) $(CONV_LIB)
LINTFLAGS += -x
LINTFLAGS64 += -x
+CERRWARN += -_gcc=-Wno-uninitialized
+
BLTDEFS = msg.h
BLTDATA = msg.c
BLTMESG = $(SGSMSGDIR)/elfwrap
diff --git a/usr/src/cmd/sgs/error/i386/Makefile b/usr/src/cmd/sgs/error/i386/Makefile
index a76c0ceb52..c08963db2a 100644
--- a/usr/src/cmd/sgs/error/i386/Makefile
+++ b/usr/src/cmd/sgs/error/i386/Makefile
@@ -19,12 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/sgs/error/i386/Makefile
PROG= error
@@ -41,6 +38,9 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
CLEANFILES += $(LINTOUT)
%.o: ../common/%.c
diff --git a/usr/src/cmd/sgs/error/sparc/Makefile b/usr/src/cmd/sgs/error/sparc/Makefile
index daa0de73e0..5415983e4c 100644
--- a/usr/src/cmd/sgs/error/sparc/Makefile
+++ b/usr/src/cmd/sgs/error/sparc/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -39,6 +37,8 @@ INCLIST= -I../common
DEFLIST= -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
C99MODE= $(C99_ENABLE)
CLEANFILES += $(LINTOUT)
diff --git a/usr/src/cmd/sgs/gprof/Makefile.com b/usr/src/cmd/sgs/gprof/Makefile.com
index bb7f707877..71f1ac66c4 100644
--- a/usr/src/cmd/sgs/gprof/Makefile.com
+++ b/usr/src/cmd/sgs/gprof/Makefile.com
@@ -45,6 +45,7 @@ C99MODE= $(C99_ENABLE)
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTSRCS = $(SRCS)
LINTFLAGS += -x
+CERRWARN += -_gcc=-Wno-uninitialized
CLEANFILES += $(LINTOUTS)
ROOTLIBBLURB= $(BLURBS:%=$(ROOTSHLIBCCS)/%)
diff --git a/usr/src/cmd/sgs/include/conv.h b/usr/src/cmd/sgs/include/conv.h
index 020cad4f53..611feb403e 100644
--- a/usr/src/cmd/sgs/include/conv.h
+++ b/usr/src/cmd/sgs/include/conv.h
@@ -24,6 +24,7 @@
* All Rights Reserved
*
* Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
*/
#ifndef _CONV_H
@@ -837,6 +838,10 @@ extern const char *conv_cnote_syscall(Word, Conv_fmt_flags_t,
Conv_inv_buf_t *);
extern const char *conv_cnote_sysset(uint32_t *, int,
Conv_fmt_flags_t, Conv_cnote_sysset_buf_t *);
+extern const char *conv_cnote_fileflags(uint32_t, Conv_fmt_flags_t,
+ char *, size_t);
+extern const char *conv_cnote_filemode(uint32_t, Conv_fmt_flags_t,
+ char *, size_t);
extern const char *conv_cnote_type(Word, Conv_fmt_flags_t,
Conv_inv_buf_t *);
extern const char *conv_def_tag(Symref, Conv_inv_buf_t *);
diff --git a/usr/src/cmd/sgs/include/dwarf.h b/usr/src/cmd/sgs/include/dwarf.h
index 31c295d17c..8bb8b75eec 100644
--- a/usr/src/cmd/sgs/include/dwarf.h
+++ b/usr/src/cmd/sgs/include/dwarf.h
@@ -232,6 +232,8 @@ extern "C" {
#define DW_EH_PE_datarel 0x30 /* Value is reletive to the beginning */
/* of the eh_frame_hdr segment */
/* ( segment type PT_AMD64_UNWIND ) */
+ /* when within that segment, or to */
+ /* the GOT when without. */
#define DW_EH_PE_funcrel 0x40
#define DW_EH_PE_aligned 0x50 /* value is an aligned void* */
#define DW_EH_PE_indirect 0x80 /* bit to signal indirection after */
@@ -251,7 +253,8 @@ typedef enum _LANG {
extern uint64_t uleb_extract(unsigned char *, uint64_t *);
extern int64_t sleb_extract(unsigned char *, uint64_t *);
extern uint64_t dwarf_ehe_extract(unsigned char *, uint64_t *,
- uint_t, unsigned char *, uint64_t, uint64_t);
+ uint_t, unsigned char *, boolean_t, uint64_t,
+ uint64_t, uint64_t);
#ifdef __cplusplus
}
diff --git a/usr/src/cmd/sgs/ld/Makefile.com b/usr/src/cmd/sgs/ld/Makefile.com
index 74c0c16c72..1462a7af29 100644
--- a/usr/src/cmd/sgs/ld/Makefile.com
+++ b/usr/src/cmd/sgs/ld/Makefile.com
@@ -41,6 +41,9 @@ LDFLAGS += $(VERSREF) $(CC_USE_PROTO) $(MAPOPTS) $(VAR_LD_LLDFLAGS)
LDLIBS += $(LDLIBDIR) $(LD_LIB) $(ELFLIBDIR) -lelf \
$(LDDBGLIBDIR) $(LDDBG_LIB) $(CONVLIBDIR) $(CONV_LIB)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+
LINTFLAGS += -x
LINTFLAGS64 += -x $(VAR_LINTFLAGS64)
diff --git a/usr/src/cmd/sgs/lex/Makefile.com b/usr/src/cmd/sgs/lex/Makefile.com
index d39bdbd037..d33a882296 100644
--- a/usr/src/cmd/sgs/lex/Makefile.com
+++ b/usr/src/cmd/sgs/lex/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= lex
@@ -47,13 +45,16 @@ SRCDIR = ../common
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
# Override default source file derivation rule (in Makefile.lib)
# from objects
#
MACHSRCS= $(MACHOBJS:%.o=../common/%.c)
LIBSRCS = $(LIBOBJS:%.o=../common/%.c)
SRCS= $(MACHSRCS) $(LIBSRCS)
-
LIBS = $(DYNLIB) $(LINTLIB)
diff --git a/usr/src/cmd/sgs/libconv/Makefile.com b/usr/src/cmd/sgs/libconv/Makefile.com
index 7c890ad68a..933176f928 100644
--- a/usr/src/cmd/sgs/libconv/Makefile.com
+++ b/usr/src/cmd/sgs/libconv/Makefile.com
@@ -87,6 +87,9 @@ CTFMERGE_LIB = :
include $(SRC)/lib/Makefile.lib
include $(SRC)/cmd/sgs/Makefile.com
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-switch
+
CTFCONVERT_O=
README_REVISION=../../packages/common/readme_revision
diff --git a/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh b/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh
index d8f29a05d6..1ca0564379 100644
--- a/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh
+++ b/usr/src/cmd/sgs/libconv/common/bld_vernote.ksh
@@ -19,8 +19,7 @@
#
# CDDL HEADER END
#
-#
-# ident "%Z%%M% %I% %E% SMI"
+
#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
@@ -46,7 +45,7 @@ pad_notestring()
build_sparcnote()
{
- notestring="Solaris Link Editors: $release-$revision\0"
+ notestring="Solaris Link Editors: $release-$revision (illumos)\0"
#
# The 'adjustment' is for the '\0'
#
@@ -69,14 +68,14 @@ cat > $notefile <<EOF
.global link_ver_string
link_ver_string:
.type link_ver_string, #object
- .ascii "${release}-${revision}\0"
+ .ascii "${release}-${revision} (illumos)\0"
.size link_ver_string, .-link_ver_string
EOF
}
build_i386note()
{
- notestring="Solaris Link Editors: $release-$revision"
+ notestring="Solaris Link Editors: $release-$revision (illumos)"
#
# The 'adjustment' is for the the fact that the x86/amd64
# assembler automatically append a '\0' at the end of a string.
@@ -99,7 +98,7 @@ cat > $notefile <<EOF
.globl link_ver_string
link_ver_string:
.type link_ver_string,@object
- .string "${release}-${revision}\0"
+ .string "${release}-${revision} (illumos)\0"
.size link_ver_string, .-link_ver_string
EOF
}
diff --git a/usr/src/cmd/sgs/libconv/common/corenote.c b/usr/src/cmd/sgs/libconv/common/corenote.c
index f30809c9cc..2fd96b3931 100644
--- a/usr/src/cmd/sgs/libconv/common/corenote.c
+++ b/usr/src/cmd/sgs/libconv/common/corenote.c
@@ -23,6 +23,9 @@
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
+/*
+ * Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+ */
/*
* String conversion routines the system structs found in
@@ -52,9 +55,9 @@ conv_cnote_type(Word type, Conv_fmt_flags_t fmt_flags,
MSG_NT_UTSNAME, MSG_NT_LWPSTATUS,
MSG_NT_LWPSINFO, MSG_NT_PRPRIV,
MSG_NT_PRPRIVINFO, MSG_NT_CONTENT,
- MSG_NT_ZONENAME
+ MSG_NT_ZONENAME, MSG_NT_FDINFO
};
-#if NT_NUM != NT_ZONENAME
+#if NT_NUM != NT_FDINFO
#error "NT_NUM has grown. Update core note types[]"
#endif
static const conv_ds_msg_t ds_types = {
@@ -2442,3 +2445,138 @@ conv_cnote_sysset(uint32_t *maskarr, int n_mask,
#undef N_MASK
}
+
+const char *
+conv_cnote_fileflags(uint32_t fileflags, Conv_fmt_flags_t fmt_flags,
+ char *buf, size_t bufsize)
+{
+ CONV_EXPN_FIELD_ARG arg = { 0 };
+
+ Val_desc vda[] = {
+ { 0x0001, MSG_PR_O_WRONLY },
+ { 0x0002, MSG_PR_O_RDONLY },
+ { 0x200000, MSG_PR_O_SEARCH },
+ { 0x400000, MSG_PR_O_EXEC },
+ { 0x0004, MSG_PR_O_NDELAY },
+ { 0x0008, MSG_PR_O_APPEND },
+ { 0x0010, MSG_PR_O_SYNC },
+ { 0x0040, MSG_PR_O_DSYNC },
+ { 0x0080, MSG_PR_O_NONBLOCK },
+ { 0x0100, MSG_PR_O_CREAT },
+ { 0x0200, MSG_PR_O_TRUNC },
+ { 0x0400, MSG_PR_O_EXCL },
+ { 0x0800, MSG_PR_O_NOCTTY },
+ { 0x4000, MSG_PR_O_XATTR },
+ { 0x8000, MSG_PR_O_RSYNC },
+ { 0x2000, MSG_PR_O_LARGEFILE },
+ { 0x20000, MSG_PR_O_NOFOLLOW },
+ { 0x40000, MSG_PR_O_NOLINKS },
+ { 0, NULL },
+ };
+
+ arg.oflags = arg.rflags = fileflags;
+ arg.buf = buf;
+ arg.bufsize = bufsize;
+
+ switch (fileflags & (0x600003)) {
+ case 0: /* RDONLY */
+ vda[0].v_msg = MSG_PR_O_RDONLY;
+ arg.oflags |= 1;
+ arg.rflags |= 1;
+ break;
+ case 1: /* WRONLY */
+ case 2: /* RDWR */
+ case 0x200000: /* SEARCH */
+ case 0x400000:
+ /* In isolate, treat these as normal bits */
+ break;
+ default:
+ /* More than one bit set in this group, emit numerically */
+ arg.oflags &= ~(fileflags & 0x600003);
+ }
+
+ if (fileflags == 0)
+ return (MSG_ORIG(MSG_GBL_ZERO));
+
+ (void) conv_expn_field(&arg, vda, fmt_flags);
+ return (buf);
+}
+
+const char *
+conv_cnote_filemode(uint32_t mode, Conv_fmt_flags_t fmt_flags,
+ char *buf, size_t bufsize)
+{
+ CONV_EXPN_FIELD_ARG arg = { 0 };
+ Msg s;
+
+ Val_desc vda[] = {
+ { 0x1000, MSG_S_IFIFO },
+ { 0x800, MSG_S_ISUID },
+ { 0x400, MSG_S_ISGID },
+ { 0x200, MSG_S_ISVTX },
+ { 0400, MSG_S_IRUSR },
+ { 0200, MSG_S_IWUSR },
+ { 0100, MSG_S_IXUSR },
+ { 0040, MSG_S_IRGRP },
+ { 0020, MSG_S_IWGRP },
+ { 0010, MSG_S_IXGRP },
+ { 0004, MSG_S_IROTH },
+ { 0002, MSG_S_IWOTH },
+ { 0001, MSG_S_IXOTH },
+ { 0, NULL },
+ };
+
+ arg.oflags = arg.rflags = mode & ~(0xf000);
+ arg.buf = buf;
+ arg.bufsize = bufsize;
+
+ switch (mode & (0xf000)) {
+ case 0x1000:
+ s = MSG_S_IFIFO;
+ break;
+ case 0x2000:
+ s = MSG_S_IFCHR;
+ break;
+ case 0x4000:
+ s = MSG_S_IFDIR;
+ break;
+ case 0x5000:
+ s = MSG_S_IFNAM;
+ break;
+ case 0x6000:
+ s = MSG_S_IFBLK;
+ break;
+ case 0x8000:
+ s = MSG_S_IFREG;
+ break;
+ case 0xA000:
+ s = MSG_S_IFLNK;
+ break;
+ case 0xc000:
+ s = MSG_S_IFSOCK;
+ break;
+ case 0xd000:
+ s = MSG_S_IFDOOR;
+ break;
+ case 0xe000:
+ s = MSG_S_IFPORT;
+ break;
+ default:
+ s = NULL;
+ break;
+ }
+
+ if (s) {
+ arg.oflags |= 0x1000;
+ arg.rflags |= 0x1000;
+ vda[0].v_msg = s;
+ } else {
+ arg.rflags = mode;
+ }
+
+ if (mode == 0)
+ return (MSG_ORIG(MSG_GBL_ZERO));
+
+ (void) conv_expn_field(&arg, vda, fmt_flags);
+ return (buf);
+}
diff --git a/usr/src/cmd/sgs/libconv/common/corenote.msg b/usr/src/cmd/sgs/libconv/common/corenote.msg
index 3774d5119a..e074c19301 100644
--- a/usr/src/cmd/sgs/libconv/common/corenote.msg
+++ b/usr/src/cmd/sgs/libconv/common/corenote.msg
@@ -23,6 +23,8 @@
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
+# Copyright 2012 DEY Storage Systems, Inc. All rights reserved.
+#
@ MSG_NT_PRSTATUS "[ NT_PRSTATUS ]"
@ MSG_NT_PRFPREG "[ NT_PRFPREG ]"
@@ -43,6 +45,7 @@
@ MSG_NT_PRPRIVINFO "[ NT_PRPRIVINFO ]"
@ MSG_NT_CONTENT "[ NT_CONTENT ]"
@ MSG_NT_ZONENAME "[ NT_ZONENAME ]"
+@ MSG_NT_FDINFO "[ NT_FDINFO ]"
@ MSG_AUXV_AF_SUN_SETUGID "AF_SUN_SETUGID"
@@ -1067,6 +1070,48 @@
@ MSG_SYS_UMOUNT2 "[ umount2 ]" # 255
@ MSG_SYS_UMOUNT2_ALT "umount2"
+@ MSG_PR_O_RDONLY "O_RDONLY"
+@ MSG_PR_O_WRONLY "O_WRONLY"
+@ MSG_PR_O_RDWR "O_RDWR"
+@ MSG_PR_O_SEARCH "O_SEARCH"
+@ MSG_PR_O_EXEC "O_EXEC"
+@ MSG_PR_O_NDELAY "O_NDELAY"
+@ MSG_PR_O_NONBLOCK "O_NONBLOCK"
+@ MSG_PR_O_APPEND "O_APPEND"
+@ MSG_PR_O_SYNC "O_SYNC"
+@ MSG_PR_O_DSYNC "O_DSYNC"
+@ MSG_PR_O_RSYNC "O_RSYNC"
+@ MSG_PR_O_CREAT "O_CREAT"
+@ MSG_PR_O_TRUNC "O_TRUNC"
+@ MSG_PR_O_EXCL "O_EXCL"
+@ MSG_PR_O_NOCTTY "O_NOCTTY"
+@ MSG_PR_O_LARGEFILE "O_LARGEFILE"
+@ MSG_PR_O_XATTR "O_XATTR"
+@ MSG_PR_O_NOFOLLOW "O_NOFOLLOW"
+@ MSG_PR_O_NOLINKS "O_NOLINKS"
+
+@ MSG_S_IFIFO "S_IFIFO"
+@ MSG_S_IFCHR "S_IFCHR"
+@ MSG_S_IFDIR "S_IFDIR"
+@ MSG_S_IFNAM "S_IFNAM"
+@ MSG_S_IFBLK "S_IFBLK"
+@ MSG_S_IFREG "S_IFREG"
+@ MSG_S_IFLNK "S_IFLNK"
+@ MSG_S_IFSOCK "S_IFSOCK"
+@ MSG_S_IFDOOR "S_IFDOOR"
+@ MSG_S_IFPORT "S_IFPORT"
+@ MSG_S_ISUID "S_ISUID"
+@ MSG_S_ISGID "S_ISGID"
+@ MSG_S_ISVTX "S_ISVTX"
+@ MSG_S_IRUSR "S_IRUSR"
+@ MSG_S_IWUSR "S_IWUSR"
+@ MSG_S_IXUSR "S_IXUSR"
+@ MSG_S_IRGRP "S_IRGRP"
+@ MSG_S_IWGRP "S_IWGRP"
+@ MSG_S_IXGRP "S_IXGRP"
+@ MSG_S_IROTH "S_IROTH"
+@ MSG_S_IWOTH "S_IWOTH"
+@ MSG_S_IXOTH "S_IXOTH"
@ MSG_GBL_ZERO "0"
diff --git a/usr/src/cmd/sgs/libelf/Makefile.com b/usr/src/cmd/sgs/libelf/Makefile.com
index 8a2f67e945..28d4e5fff8 100644
--- a/usr/src/cmd/sgs/libelf/Makefile.com
+++ b/usr/src/cmd/sgs/libelf/Makefile.com
@@ -70,6 +70,9 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc
LINTFLAGS += -u -erroff=E_BAD_PTR_CAST_ALIGN
LINTFLAGS64 += -u -erroff=E_CAST_INT_TO_SMALL_INT
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
BUILD.AR= $(RM) $@ ; \
$(AR) q $@ `$(LORDER) $(OBJECTS:%=$(DIR)/%)| $(TSORT)`
$(POST_PROCESS_A)
diff --git a/usr/src/cmd/sgs/libld/Makefile.com b/usr/src/cmd/sgs/libld/Makefile.com
index 664a9a890e..0141955f16 100644
--- a/usr/src/cmd/sgs/libld/Makefile.com
+++ b/usr/src/cmd/sgs/libld/Makefile.com
@@ -41,7 +41,7 @@ COMOBJS64 = args64.o entry64.o exit64.o groups64.o \
ldentry64.o ldlibs64.o ldmachdep64.o ldmain64.o \
libs64.o files64.o map64.o map_core64.o \
map_support64.o map_v264.o order64.o outfile64.o \
- place64.o relocate64.o resolve64.o sections64.o \
+ place64.o relocate64.o resolve64.o sections64.o \
sunwmove64.o support64.o syms64.o update64.o \
unwind64.o version64.o wrap64.o
@@ -87,6 +87,12 @@ include $(SRC)/cmd/sgs/Makefile.com
SRCDIR = ../common
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-type-limits
# Location of the shared relocation engines maintained under usr/src/uts.
#
diff --git a/usr/src/cmd/sgs/libld/common/files.c b/usr/src/cmd/sgs/libld/common/files.c
index 7f85d3abad..c1e66ecfea 100644
--- a/usr/src/cmd/sgs/libld/common/files.c
+++ b/usr/src/cmd/sgs/libld/common/files.c
@@ -1429,6 +1429,7 @@ is_name_cmp(const char *is_name, const char *match_name, size_t match_len)
* are updated as necessary to reflect the changes. Returns TRUE
* for success, FALSE for failure.
*/
+/*ARGSUSED*/
inline static Boolean
process_progbits_alloc(const char *name, Ifl_desc *ifl, Shdr *shdr,
Word ndx, int *ident, Ofl_desc *ofl, Boolean is_stab_index,
@@ -1437,8 +1438,6 @@ process_progbits_alloc(const char *name, Ifl_desc *ifl, Shdr *shdr,
Boolean done = FALSE;
if (name[0] == '.') {
- Conv_inv_buf_t inv_buf1, inv_buf2;
-
switch (name[1]) {
case 'e':
if (!is_name_cmp(name, MSG_ORIG(MSG_SCN_EHFRAME),
diff --git a/usr/src/cmd/sgs/libld/common/unwind.c b/usr/src/cmd/sgs/libld/common/unwind.c
index 20d7051a4f..1e10b4664d 100644
--- a/usr/src/cmd/sgs/libld/common/unwind.c
+++ b/usr/src/cmd/sgs/libld/common/unwind.c
@@ -639,8 +639,8 @@ ld_unwind_populate_hdr(Ofl_desc *ofl)
(void) dwarf_ehe_extract(
&data[off + ndx],
&ndx, ciePflag,
- ofl->ofl_dehdr->e_ident,
- shdr->sh_addr, off + ndx);
+ ofl->ofl_dehdr->e_ident, B_FALSE,
+ shdr->sh_addr, off + ndx, 0);
break;
case 'R':
/* code encoding */
@@ -658,10 +658,17 @@ ld_unwind_populate_hdr(Ofl_desc *ofl)
uint_t bintabndx;
uint64_t initloc;
uint64_t fdeaddr;
+ uint64_t gotaddr = 0;
+
+ if (ofl->ofl_osgot != NULL)
+ gotaddr =
+ ofl->ofl_osgot->os_shdr->sh_addr;
initloc = dwarf_ehe_extract(&data[off],
&ndx, cieRflag, ofl->ofl_dehdr->e_ident,
- shdr->sh_addr, off + ndx);
+ B_FALSE,
+ shdr->sh_addr, off + ndx,
+ gotaddr);
/*
* Ignore FDEs with initloc set to 0.
diff --git a/usr/src/cmd/sgs/liblddbg/Makefile.com b/usr/src/cmd/sgs/liblddbg/Makefile.com
index c6a00e5710..d1dc9dd27c 100644
--- a/usr/src/cmd/sgs/liblddbg/Makefile.com
+++ b/usr/src/cmd/sgs/liblddbg/Makefile.com
@@ -31,7 +31,7 @@ COMOBJS = args.o audit.o basic.o debug.o \
COMOBJS32 = bindings32.o cap32.o dlfcns32.o dynamic32.o \
elf32.o entry32.o files32.o got32.o \
- libs32.o map32.o move32.o phdr32.o \
+ libs32.o map32.o move32.o phdr32.o \
relocate32.o sections32.o segments32.o shdr32.o \
statistics32.o support32.o syms32.o unused32.o \
util32.o version32.o
@@ -58,6 +58,10 @@ SRCDIR = ../common
LINTFLAGS += -u -D_REENTRANT
LINTFLAGS64 += -u -D_REENTRANT
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
CPPFLAGS += -I$(SRCBASE)/lib/libc/inc
DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN'
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc
diff --git a/usr/src/cmd/sgs/librtld/Makefile.com b/usr/src/cmd/sgs/librtld/Makefile.com
index 59610b7263..f196ac328a 100644
--- a/usr/src/cmd/sgs/librtld/Makefile.com
+++ b/usr/src/cmd/sgs/librtld/Makefile.com
@@ -45,6 +45,11 @@ CPPFLAGS += -I../../rtld/common -I$(SRCBASE)/lib/libc/inc \
DYNFLAGS += $(VERSREF) $(CC_USE_PROTO) '-R$$ORIGIN'
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf -lc
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
diff --git a/usr/src/cmd/sgs/librtld_db/Makefile.com b/usr/src/cmd/sgs/librtld_db/Makefile.com
index ddddc5d73e..955f3e21d8 100644
--- a/usr/src/cmd/sgs/librtld_db/Makefile.com
+++ b/usr/src/cmd/sgs/librtld_db/Makefile.com
@@ -42,6 +42,8 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) -lc
LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
+CERRWARN += -_gcc=-Wno-uninitialized
+
BLTDEFS= msg.h
BLTDATA= msg.c
diff --git a/usr/src/cmd/sgs/m4/i386/Makefile b/usr/src/cmd/sgs/m4/i386/Makefile
index eb9d756285..0a13a85c48 100644
--- a/usr/src/cmd/sgs/m4/i386/Makefile
+++ b/usr/src/cmd/sgs/m4/i386/Makefile
@@ -22,10 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-# cmd/sgs/m4/i386/Makefile
-#
PROG= m4
XPG4PROG= m4
@@ -56,6 +52,10 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTFLAGS += $(LDLIBS)
CLEANFILES += $(LINTOUT) $(BLTSRCS)
diff --git a/usr/src/cmd/sgs/m4/sparc/Makefile b/usr/src/cmd/sgs/m4/sparc/Makefile
index 99a71f05ca..ecda17a550 100644
--- a/usr/src/cmd/sgs/m4/sparc/Makefile
+++ b/usr/src/cmd/sgs/m4/sparc/Makefile
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# cmd/sgs/m4/sparc/Makefile
#
@@ -54,6 +52,9 @@ INCLIST= -I../common
DEFLIST= -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
C99MODE= $(C99_ENABLE)
LINTFLAGS += $(LDLIBS)
diff --git a/usr/src/cmd/sgs/mcs/Makefile.com b/usr/src/cmd/sgs/mcs/Makefile.com
index 322a9feb37..137286fc6c 100644
--- a/usr/src/cmd/sgs/mcs/Makefile.com
+++ b/usr/src/cmd/sgs/mcs/Makefile.com
@@ -49,6 +49,8 @@ LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS += -x
LINTFLAGS64 += -x
+CERRWARN += -_gcc=-Wno-uninitialized
+
SRCS = $(COMOBJS:%.o=../common/%.c) \
$(TOOLSOBJS:%.o=$(SGSTOOLS)/common/%.c)
LINTSRCS = $(SRCS) ../common/lintsup.c
diff --git a/usr/src/cmd/sgs/nm/amd64/Makefile b/usr/src/cmd/sgs/nm/amd64/Makefile
index f2a8c30347..72bbbbb1d4 100644
--- a/usr/src/cmd/sgs/nm/amd64/Makefile
+++ b/usr/src/cmd/sgs/nm/amd64/Makefile
@@ -40,6 +40,9 @@ LDFLAGS += '-R$$ORIGIN/../../../lib/$(MACH64)'
INCLIST= -I../../include -I../../include/i386 \
-I$(SRCBASE)/uts/$(ARCH)/sys
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP)
+
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS64 += -x $(LDLIBS) -m64
LINTSRCS= $(SRCS)
diff --git a/usr/src/cmd/sgs/nm/i386/Makefile b/usr/src/cmd/sgs/nm/i386/Makefile
index 6653481253..f351d68aca 100644
--- a/usr/src/cmd/sgs/nm/i386/Makefile
+++ b/usr/src/cmd/sgs/nm/i386/Makefile
@@ -44,6 +44,9 @@ INCLIST= -I../../include -I../../include/i386 \
-I$(SRCBASE)/uts/$(ARCH)/sys
DEFLIST= -DTARGET=I386 -DI386=1 -D$(ARFORMAT) -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP)
+
+CERRWARN += -_gcc=-Wno-uninitialized
+
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS += -x $(LDLIBS)
LINTSRCS= $(SRCS)
diff --git a/usr/src/cmd/sgs/nm/sparc/Makefile b/usr/src/cmd/sgs/nm/sparc/Makefile
index cd94ccfa0d..056fa29160 100644
--- a/usr/src/cmd/sgs/nm/sparc/Makefile
+++ b/usr/src/cmd/sgs/nm/sparc/Makefile
@@ -45,6 +45,7 @@ INCLIST= -I../../include -I../../include/sparc \
-I$(SRCBASE)/uts/$(ARCH)/sys
DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS= -x $(LDLIBS)
LINTSRCS= $(SRCS)
diff --git a/usr/src/cmd/sgs/nm/sparcv9/Makefile b/usr/src/cmd/sgs/nm/sparcv9/Makefile
index 51fbab7770..55fb1cd328 100644
--- a/usr/src/cmd/sgs/nm/sparcv9/Makefile
+++ b/usr/src/cmd/sgs/nm/sparcv9/Makefile
@@ -43,6 +43,7 @@ INCLIST= -I../../include -I../../include/sparc \
-I$(SRCBASE)/uts/$(ARCH)/sys
DEFLIST= -DTARGET=SPARC -DSPARC=1 -D$(ARFORMAT) -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += $(CONVLIBDIR64) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTFLAGS64= -x $(LDLIBS) -m64
LINTSRCS= $(SRCS)
diff --git a/usr/src/cmd/sgs/packages/common/SUNWonld-README b/usr/src/cmd/sgs/packages/common/SUNWonld-README
index 67c224ca95..184212bfb8 100644
--- a/usr/src/cmd/sgs/packages/common/SUNWonld-README
+++ b/usr/src/cmd/sgs/packages/common/SUNWonld-README
@@ -1631,3 +1631,12 @@ Bugid Risk Synopsis
================================================================================
308 ld may misalign sections only preceded by empty sections
+1301 ld crashes with '-z ignore' due to a null data descriptor
+1626 libld may accidentally return success while failing
+2413 %ymm* need to be preserved on way through PLT
+3210 ld should tolerate SHT_PROGBITS for .eh_frame sections on amd64
+3228 Want -zassert-deflib for ld
+3230 ld.so.1 should check default paths for DT_DEPAUDIT
+3260 linker is insufficiently careful with strtok
+3261 linker should ignore unknown hardware capabilities
+3265 link-editor builds bogus .eh_frame_hdr on ia32
diff --git a/usr/src/cmd/sgs/prof/Makefile.com b/usr/src/cmd/sgs/prof/Makefile.com
index 32ed03f0c5..edaaa695f8 100644
--- a/usr/src/cmd/sgs/prof/Makefile.com
+++ b/usr/src/cmd/sgs/prof/Makefile.com
@@ -42,6 +42,7 @@ INCLIST= -I../common -I../../include -I../../include/$(MACH)
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master) -I$(ELFCAP)
CFLAGS += $(CCVERBOSE)
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += $(CONVLIBDIR) $(CONV_LIB) $(ELFLIBDIR) -lelf
LINTSRCS = $(SRCS)
LINTFLAGS += -x
diff --git a/usr/src/cmd/sgs/rtld/Makefile.com b/usr/src/cmd/sgs/rtld/Makefile.com
index f2c06076ae..037141b7a4 100644
--- a/usr/src/cmd/sgs/rtld/Makefile.com
+++ b/usr/src/cmd/sgs/rtld/Makefile.com
@@ -85,6 +85,10 @@ ASFLAGS= -P -D_ASM $(CPPFLAGS)
LDLIB = -L ../../libld/$(MACH)
RTLDLIB = -L ../../librtld/$(MACH)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-switch
+
# These definitions require that libc be built in the same workspace
# as the run-time linker and before the run-time linker is built.
# This is required for the system's self-consistency in any case.
diff --git a/usr/src/cmd/sgs/rtld/common/cap.c b/usr/src/cmd/sgs/rtld/common/cap.c
index 93302468c9..9aa82022be 100644
--- a/usr/src/cmd/sgs/rtld/common/cap.c
+++ b/usr/src/cmd/sgs/rtld/common/cap.c
@@ -858,8 +858,9 @@ cap_modify(Xword tag, const char *str)
if ((caps = strdup(str)) == NULL)
return (0);
- ptr = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next);
- do {
+ for (ptr = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next);
+ ptr != NULL;
+ ptr = strtok_r(NULL, MSG_ORIG(MSG_CAP_DELIMIT), &next)) {
Xword val = 0;
/*
@@ -921,6 +922,8 @@ cap_modify(Xword tag, const char *str)
* Invalid indexes are ignored.
*/
if (val == 0) {
+ char *end;
+
if ((*ptr == '[') && (*(ptr + 2) == ']')) {
if (*(ptr + 1) == '1') {
ndx = tag;
@@ -941,14 +944,25 @@ cap_modify(Xword tag, const char *str)
ndx = tag;
errno = 0;
- if (((val = strtol(ptr, NULL, 16)) == 0) && errno)
+ if (((val = strtol(ptr, &end, 16)) == 0) && errno)
+ continue;
+
+ /*
+ * If the value wasn't an entirely valid hexadecimal
+ * integer, assume it was intended as a capability
+ * name and skip it.
+ */
+ if (*end != '\0') {
+ eprintf(NULL, ERR_WARNING,
+ MSG_INTL(MSG_CAP_IGN_UNKCAP), ptr);
continue;
+ }
}
+
cap_settings[ndx - 1].cs_val[mode] |= val;
cap_settings[ndx - 1].cs_set[mode]++;
- } while ((ptr = strtok_r(NULL,
- MSG_ORIG(MSG_CAP_DELIMIT), &next)) != NULL);
+ }
/*
* If the "override" token was supplied, set the alternative
@@ -982,8 +996,9 @@ cap_files(const char *str)
if ((caps = strdup(str)) == NULL)
return (0);
- name = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next);
- do {
+ for (name = strtok_r(caps, MSG_ORIG(MSG_CAP_DELIMIT), &next);
+ name != NULL;
+ name = strtok_r(NULL, MSG_ORIG(MSG_CAP_DELIMIT), &next)) {
avl_index_t where;
PathNode *pnp;
uint_t hash = sgs_str_hash(name);
@@ -999,8 +1014,7 @@ cap_files(const char *str)
pnp->pn_hash = hash;
avl_insert(capavl, pnp, where);
}
- } while ((name = strtok_r(NULL,
- MSG_ORIG(MSG_CAP_DELIMIT), &next)) != NULL);
+ }
return (1);
}
diff --git a/usr/src/cmd/sgs/rtld/common/rtld.msg b/usr/src/cmd/sgs/rtld/common/rtld.msg
index 0d3811b003..0a3cb5d74a 100644
--- a/usr/src/cmd/sgs/rtld/common/rtld.msg
+++ b/usr/src/cmd/sgs/rtld/common/rtld.msg
@@ -300,6 +300,7 @@
@ MSG_STR_ONE "1"
@ MSG_CAP_DELIMIT ","
+@ MSG_CAP_IGN_UNKCAP "ignoring unknown capability: %s"
@ MSG_SUNW_OST_SGS "SUNW_OST_SGS"
@ MSG_SUNW_OST_OSLIB "SUNW_OST_OSLIB"
diff --git a/usr/src/cmd/sgs/rtld/common/setup.c b/usr/src/cmd/sgs/rtld/common/setup.c
index f1092a674f..c5d2a2671e 100644
--- a/usr/src/cmd/sgs/rtld/common/setup.c
+++ b/usr/src/cmd/sgs/rtld/common/setup.c
@@ -104,8 +104,10 @@ preload(const char *str, Rt_map *mlmp, Rt_map **clmp)
lddstub = (lmflags & LML_FLG_TRC_ENABLE) &&
(FLAGS1(*clmp) & FL1_RT_LDDSTUB);
- ptr = strtok_r(objs, MSG_ORIG(MSG_STR_DELIMIT), &next);
- do {
+
+ for (ptr = strtok_r(objs, MSG_ORIG(MSG_STR_DELIMIT), &next);
+ ptr != NULL;
+ ptr = strtok_r(NULL, MSG_ORIG(MSG_STR_DELIMIT), &next)) {
Rt_map *nlmp = NULL;
uint_t flags;
@@ -179,8 +181,7 @@ preload(const char *str, Rt_map *mlmp, Rt_map **clmp)
if (flags & FLG_RT_OBJINTPO)
lml_main.lm_flags |= LML_FLG_INTRPOSE;
- } while ((ptr = strtok_r(NULL,
- MSG_ORIG(MSG_STR_DELIMIT), &next)) != NULL);
+ }
free(palp);
free(objs);
diff --git a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com
index b2ab5da932..740a33d3d0 100644
--- a/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com
+++ b/usr/src/cmd/sgs/rtld/mdbmod/Makefile.com
@@ -50,6 +50,8 @@ SGSMSGFLAGS += -h $(BLTDEFS) -d $(BLTDATA)
LINTFLAGS += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
LINTFLAGS64 += -u -erroff=E_NAME_DECL_NOT_USED_DEF2
+CERRWARN += -_gcc=-Wno-uninitialized
+
LINTSRCS= $(COMOBJS:%.o=../common/%.c) $(BLTDATA)
FILEMODE= 555
diff --git a/usr/src/cmd/sgs/size/Makefile.com b/usr/src/cmd/sgs/size/Makefile.com
index e28c593b0a..c84525db97 100644
--- a/usr/src/cmd/sgs/size/Makefile.com
+++ b/usr/src/cmd/sgs/size/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= size
@@ -35,6 +33,8 @@ COMOBJS= main.o process.o fcns.o
SRCS= $(COMOBJS:%.o=../common/%.c)
+CERRWARN += -_gcc=-Wno-unused-variable
+
OBJS = $(COMOBJS)
.PARALLEL: $(OBJS)
diff --git a/usr/src/cmd/sgs/test/README b/usr/src/cmd/sgs/test/README
new file mode 100644
index 0000000000..d63f91a0ce
--- /dev/null
+++ b/usr/src/cmd/sgs/test/README
@@ -0,0 +1,19 @@
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc.
+#
+
+This directory contains various unit tests for parts of the sgs source tree.
+There currently is no master runner for these tests, you should run them
+individually. You will need to manually make test executable. Currently tests
+expect to be given a path to the proto area.
diff --git a/usr/src/cmd/sgs/test/ld/assert-deflib/link.c b/usr/src/cmd/sgs/test/ld/assert-deflib/link.c
new file mode 100644
index 0000000000..823c7a3785
--- /dev/null
+++ b/usr/src/cmd/sgs/test/ld/assert-deflib/link.c
@@ -0,0 +1,23 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source. A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright (c) 2012, Joyent, Inc.
+ */
+
+#include <stdio.h>
+
+int
+main(void)
+{
+ (void) printf("Hello, world!\n");
+ return (0);
+}
diff --git a/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh b/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh
new file mode 100644
index 0000000000..cf07c35788
--- /dev/null
+++ b/usr/src/cmd/sgs/test/ld/assert-deflib/test-deflib.sh
@@ -0,0 +1,135 @@
+#!/bin/bash
+#
+# This file and its contents are supplied under the terms of the
+# Common Development and Distribution License ("CDDL"), version 1.0.
+# You may only use this file in accordance with the terms of version
+# 1.0 of the CDDL.
+#
+# A full copy of the text of the CDDL should have accompanied this
+# source. A copy of the CDDL is also available via the Internet at
+# http://www.illumos.org/license/CDDL.
+#
+
+#
+# Copyright (c) 2012, Joyent, Inc.
+#
+
+#
+# This test validates that the -zassert-deflib option of ld(1) works correctly.
+# It requires that some cc is in your path and that you have passed in the path
+# to the proto area with the new version of libld.so.4. One thing that we have
+# to do is be careful with using LD_LIBRARY_PATH. Setting LD_LIBRARY_PATH does
+# not change the default search path so we want to make sure that we use a
+# different ISA (e.g. 32-bit vs 64-bit) from the binary we're generating.
+#
+unalias -a
+
+sh_path=
+sh_lib="lib"
+sh_lib64="$sh_lib/64"
+sh_soname="libld.so.4"
+sh_cc="cc"
+sh_cflags="-m32"
+sh_file="link.c"
+sh_arg0=$(basename $0)
+
+function fatal
+{
+ local msg="$*"
+ [[ -z "$msg" ]] && msg="failed"
+ echo "$sh_arg0: $msg" >&2
+ exit 1
+}
+
+
+#
+# Validate that everything we need is in our path. That includes having cc
+# and the proto area libld.
+#
+function validate
+{
+ [[ -f $sh_path/$sh_lib/$sh_soname ]] || fatal "missing 32-bit $sh_soname"
+ [[ -f $sh_path/$sh_lib64/$sh_soname ]] ||
+ fatal "missing 64-bit $sh_soname"
+ which $sh_cc >/dev/null || fatal "cc not in path"
+}
+
+#
+# $1 is a series of flags to append
+# $2 is expected exit status
+# $3 is pre-test message
+# $4 is the failure message
+#
+function run
+{
+ local ret
+
+ echo $3
+ LD_LIBRARY_PATH_64="$sh_path/$sh_lib64" $sh_cc $sh_cflags $sh_file $1
+ if [[ $? -eq $2 ]]; then
+ printf "success\n\n"
+ else
+ fatal $4
+ fi
+}
+
+sh_path=$1
+[[ -z "$1" ]] && fatal "<proto root>"
+validate
+
+run "-Wl,-zassert-deflib" 0 \
+ "Testing basic compilation succeeds with warnings..." \
+ "failed to compile with warnings"
+
+run "-Wl,-zassert-deflib -Wl,-zfatal-warnings" 1 \
+ "Testing basic compilation fails if warning are fatal..." \
+ "linking succeeeded, expected failure"
+
+run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings" 0 \
+ "Testing basic exception with fatal warnings..." \
+ "linking failed despite exception"
+
+run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings" 0 \
+ "Testing basic exception with fatal warnings..." \
+ "linking failed despite exception"
+
+
+run "-Wl,-zassert-deflib=lib.so -Wl,-zfatal-warnings" 1 \
+ "Testing invalid library name..." \
+ "ld should not allow invalid library name"
+
+run "-Wl,-zassert-deflib=libf -Wl,-zfatal-warnings" 1 \
+ "Testing invalid library name..." \
+ "ld should not allow invalid library name"
+
+run "-Wl,-zassert-deflib=libf.s -Wl,-zfatal-warnings" 1 \
+ "Testing invalid library name..." \
+ "ld should not allow invalid library name"
+
+run "-Wl,-zassert-deflib=libc.so -Wl,-zfatal-warnings -lelf" 1 \
+ "Errors even if one library is under exception path..." \
+ "one exception shouldn't stop another"
+
+args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libelf.so"
+args="$args -Wl,-zfatal-warnings -lelf"
+
+run "$args" 0 \
+ "Multiple exceptions work..." \
+ "multiple exceptions don't work"
+
+args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libelfe.so"
+args="$args -Wl,-zfatal-warnings -lelf"
+
+run "$args" 1 \
+ "Exceptions only catch the specific library" \
+ "exceptions caught the wrong library"
+
+args="-Wl,-zassert-deflib=libc.so -Wl,-zassert-deflib=libel.so"
+args="$args -Wl,-zfatal-warnings -lelf"
+
+run "$args" 1 \
+ "Exceptions only catch the specific library" \
+ "exceptions caught the wrong library"
+
+echo "Tests passed."
+exit 0
diff --git a/usr/src/cmd/sgs/tools/common/leb128.c b/usr/src/cmd/sgs/tools/common/leb128.c
index 1183e6f854..42ed001e15 100644
--- a/usr/src/cmd/sgs/tools/common/leb128.c
+++ b/usr/src/cmd/sgs/tools/common/leb128.c
@@ -190,12 +190,16 @@ sleb_extract(unsigned char *data, uint64_t *dotp)
* at which the desired datum starts.
* ehe_flags - DWARF encoding
* eident - ELF header e_ident[] array for object being processed
+ * frame_hdr - Boolean, true if we're extracting from .eh_frame_hdr
* sh_base - Base address of ELF section containing desired datum
* sh_offset - Offset relative to sh_base of desired datum.
+ * dbase - The base address to which DW_EH_PE_datarel is relative
+ * (if frame_hdr is false)
*/
uint64_t
dwarf_ehe_extract(unsigned char *data, uint64_t *dotp, uint_t ehe_flags,
- unsigned char *eident, uint64_t sh_base, uint64_t sh_offset)
+ unsigned char *eident, boolean_t frame_hdr, uint64_t sh_base,
+ uint64_t sh_offset, uint64_t dbase)
{
uint64_t dot = *dotp;
uint_t lsb;
@@ -281,17 +285,27 @@ dwarf_ehe_extract(unsigned char *data, uint64_t *dotp, uint_t ehe_flags,
/*
* If value is relative to a base address, adjust it
*/
- if (result) {
- switch (ehe_flags & 0xf0) {
- case DW_EH_PE_pcrel:
- result += sh_base + sh_offset;
- break;
+ switch (ehe_flags & 0xf0) {
+ case DW_EH_PE_pcrel:
+ result += sh_base + sh_offset;
+ break;
- case DW_EH_PE_datarel:
+ /*
+ * datarel is relative to .eh_frame_hdr if within .eh_frame,
+ * but GOT if not.
+ */
+ case DW_EH_PE_datarel:
+ if (frame_hdr)
result += sh_base;
- break;
- }
+ else
+ result += dbase;
+ break;
}
+
+ /* Truncate the result to its specified size */
+ result = (result << ((sizeof (uint64_t) - fsize) * 8)) >>
+ ((sizeof (uint64_t) - fsize) * 8);
+
*dotp = dot;
return (result);
}
diff --git a/usr/src/cmd/sgs/tsort/i386/Makefile b/usr/src/cmd/sgs/tsort/i386/Makefile
index a01e70f078..c565d58a91 100644
--- a/usr/src/cmd/sgs/tsort/i386/Makefile
+++ b/usr/src/cmd/sgs/tsort/i386/Makefile
@@ -19,14 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/sgs/tsort/i386/Makefile
-#
PROG= tsort
@@ -43,6 +38,8 @@ CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
C99MODE= $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-parentheses
+
CLEANFILES += $(LINTOUT)
%.o: ../common/%.c
diff --git a/usr/src/cmd/sgs/tsort/sparc/Makefile b/usr/src/cmd/sgs/tsort/sparc/Makefile
index 289a26aa1d..508983d078 100644
--- a/usr/src/cmd/sgs/tsort/sparc/Makefile
+++ b/usr/src/cmd/sgs/tsort/sparc/Makefile
@@ -19,9 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -41,6 +38,7 @@ SRCS= $(OBJS:%.o=../common/%.c)
DEFLIST= -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
C99MODE= $(C99_ENABLE)
CLEANFILES += $(LINTOUT)
diff --git a/usr/src/cmd/sgs/unifdef/i386/Makefile b/usr/src/cmd/sgs/unifdef/i386/Makefile
index 8c61cd7c65..33f7b96b30 100644
--- a/usr/src/cmd/sgs/unifdef/i386/Makefile
+++ b/usr/src/cmd/sgs/unifdef/i386/Makefile
@@ -19,13 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/sgs/unifdef/i386/Makefile
-#
PROG= unifdef
@@ -43,6 +39,9 @@ LINTFLAGS += $(LDLIBS)
CLEANFILES += $(LINTOUT)
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+
%.o: ../common/%.c
$(COMPILE.c) $<
diff --git a/usr/src/cmd/sgs/unifdef/sparc/Makefile b/usr/src/cmd/sgs/unifdef/sparc/Makefile
index 55b099b227..0a16f4c5f0 100644
--- a/usr/src/cmd/sgs/unifdef/sparc/Makefile
+++ b/usr/src/cmd/sgs/unifdef/sparc/Makefile
@@ -19,13 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/sgs/unifdef/sparc/Makefile
-#
PROG= unifdef
@@ -38,6 +34,8 @@ SRCS= $(OBJS:%.o=../common/%.c)
DEFLIST= -DELF_OBJ -DELF
CPPFLAGS= $(INCLIST) $(DEFLIST) $(CPPFLAGS.master)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
C99MODE= $(C99_ENABLE)
LINTFLAGS += $(LDLIBS)
diff --git a/usr/src/cmd/sgs/yacc/Makefile.com b/usr/src/cmd/sgs/yacc/Makefile.com
index 009a2d41fa..4b9a945978 100644
--- a/usr/src/cmd/sgs/yacc/Makefile.com
+++ b/usr/src/cmd/sgs/yacc/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= yacc
@@ -67,6 +65,8 @@ LINTPOUT= lint.out
C99MODE= $(C99_ENABLE)
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
$(LINTLIB):= LINTFLAGS = -nvx
$(ROOTPROG):= FILEMODE = 0555
diff --git a/usr/src/cmd/sh/Makefile b/usr/src/cmd/sh/Makefile
index b0741b195b..f1b67294ce 100644
--- a/usr/src/cmd/sh/Makefile
+++ b/usr/src/cmd/sh/Makefile
@@ -41,6 +41,10 @@ POFILES= $(SRCS:%.c=%.po)
XGETFLAGS += -a -x sh.xcl
CPPFLAGS += -D_FILE_OFFSET_BITS=64 -DACCT
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-unused-variable
MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
LDFLAGS += $(MAPFILES:%=-M%)
LDLIBS += -lgen
diff --git a/usr/src/cmd/shcomp/Makefile b/usr/src/cmd/shcomp/Makefile
index 63ee23fa07..d09f5945c1 100644
--- a/usr/src/cmd/shcomp/Makefile
+++ b/usr/src/cmd/shcomp/Makefile
@@ -61,6 +61,8 @@ CFLAGS += \
CFLAGS64 += \
$(ASTCFLAGS64)
+CERRWARN += -_gcc=-Wno-parentheses
+
ROOTCMDDIR=$(ROOT)/usr/bin
PROG= shcomp
diff --git a/usr/src/cmd/smbsrv/smbadm/Makefile b/usr/src/cmd/smbsrv/smbadm/Makefile
index ccf2a8436c..3cdc52d13f 100644
--- a/usr/src/cmd/smbsrv/smbadm/Makefile
+++ b/usr/src/cmd/smbsrv/smbadm/Makefile
@@ -32,6 +32,10 @@ include ../Makefile.smbsrv.defs
LDLIBS += -L$(ROOT)/usr/lib/smbsrv -lsmb -lsecdb -lumem
LDFLAGS += -R/usr/lib/smbsrv
+.KEEP_STATE:
+
+CERRWARN += -_gcc=-Wno-uninitialized
+
all: $(PROG)
clean:
diff --git a/usr/src/cmd/smserverd/Makefile b/usr/src/cmd/smserverd/Makefile
index 34597f4d15..f138639025 100644
--- a/usr/src/cmd/smserverd/Makefile
+++ b/usr/src/cmd/smserverd/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = rpc.smserverd
OBJS = smediad.o smediad_err.o myaudit.o smed_svc.o smed_xdr.o
@@ -47,6 +45,8 @@ LDLIBS += -lnsl -lbsm
CPPFLAGS += -D_REENTRANT
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
LINTFLAGS += -u
.KEEP_STATE:
diff --git a/usr/src/cmd/soelim/Makefile b/usr/src/cmd/soelim/Makefile
index bddde2ea1a..1dc7c5890b 100644
--- a/usr/src/cmd/soelim/Makefile
+++ b/usr/src/cmd/soelim/Makefile
@@ -20,12 +20,8 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/soelim/Makefile
-#
include ../Makefile.cmd
@@ -35,13 +31,14 @@ OBJS = soelim.o
SRCS = $(OBJS:%.o=%.c)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
all : $(PROG)
$(PROG) : soelim.o
$(LINK.c) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
$(POST_PROCESS)
-
+
install : all $(ROOTPROG)
clean:
diff --git a/usr/src/cmd/sort/Makefile.com b/usr/src/cmd/sort/Makefile.com
index 922cab1f38..a65ab5327a 100644
--- a/usr/src/cmd/sort/Makefile.com
+++ b/usr/src/cmd/sort/Makefile.com
@@ -23,9 +23,7 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-# sort(1) Makefile.com
+
#
# Debugging targets
# sort provides a number of debugging options to simplify failure analysis.
@@ -86,6 +84,10 @@ CFLAGS64 += $(CCVERBOSE) $(SORT_DEBUG)
CPPFLAGS += -D_FILE_OFFSET_BITS=64
LINTFLAGS += -U_FILE_OFFSET_BITS
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
$(XPG4) := CFLAGS += -DXPG4
debug := SORT_DEBUG = -g -DDEBUG $(ILDOFF)
diff --git a/usr/src/cmd/spell/Makefile b/usr/src/cmd/spell/Makefile
index 9fdcb2ebc9..659481df0a 100644
--- a/usr/src/cmd/spell/Makefile
+++ b/usr/src/cmd/spell/Makefile
@@ -20,13 +20,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/spell/Makefile
-#
HASHPROG= hashmk1 spellin1
SHPROG= spell compress
@@ -55,6 +51,7 @@ TXTS= compress.sh spell.sh
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
XGETFLAGS += -a -x spell.xcl
diff --git a/usr/src/cmd/sqlite/Makefile b/usr/src/cmd/sqlite/Makefile
index 5cc113b608..86a329605b 100644
--- a/usr/src/cmd/sqlite/Makefile
+++ b/usr/src/cmd/sqlite/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= sqlite
@@ -41,6 +39,8 @@ OBJS= shell.o
$(OBJS) := CFLAGS += $(CTF_FLAGS)
$(OBJS) := CTFCONVERT_POST = $(CTFCONVERT_O)
+CERRWARN += -_gcc=-Wno-empty-body
+
.KEEP_STATE:
$(ROOTSQLITE) := FILEMODE= 555
diff --git a/usr/src/cmd/srchtxt/Makefile b/usr/src/cmd/srchtxt/Makefile
index 609a29dc9b..8adc2f68c5 100644
--- a/usr/src/cmd/srchtxt/Makefile
+++ b/usr/src/cmd/srchtxt/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -29,6 +27,7 @@ PROG= srchtxt
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
LDLIBS += -lgen
.KEEP_STATE:
diff --git a/usr/src/cmd/ssh/Makefile.ssh-common b/usr/src/cmd/ssh/Makefile.ssh-common
index f931266862..25a9c2560f 100644
--- a/usr/src/cmd/ssh/Makefile.ssh-common
+++ b/usr/src/cmd/ssh/Makefile.ssh-common
@@ -79,6 +79,11 @@ LINTFLAGS += \
-erroff=E_STMT_NOT_REACHED \
-errtags=yes
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-unused-variable
+
ROOTLIBSSH= $(ROOTLIB)/ssh
ROOTLIBSSHPROG= $(PROG:%=$(ROOTLIBSSH)/%)
diff --git a/usr/src/cmd/stat/fsstat/Makefile b/usr/src/cmd/stat/fsstat/Makefile
index 17a0e34f1b..26bfdb023b 100644
--- a/usr/src/cmd/stat/fsstat/Makefile
+++ b/usr/src/cmd/stat/fsstat/Makefile
@@ -35,6 +35,7 @@ COMMON_SRCS = $(COMMON_OBJS:%.o=$(STATCOMMONDIR)/%.c)
LDLIBS += -lkstat
CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR}
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 0555
lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR)
diff --git a/usr/src/cmd/stat/iostat/Makefile b/usr/src/cmd/stat/iostat/Makefile
index bbc3b4c8c1..36142d5a8a 100644
--- a/usr/src/cmd/stat/iostat/Makefile
+++ b/usr/src/cmd/stat/iostat/Makefile
@@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat
LDLIBS += -lkstat -ldevinfo -lavl
CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR}
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 0555
lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR)
diff --git a/usr/src/cmd/stat/mpstat/Makefile b/usr/src/cmd/stat/mpstat/Makefile
index c8638ebb49..fd3d57dafb 100644
--- a/usr/src/cmd/stat/mpstat/Makefile
+++ b/usr/src/cmd/stat/mpstat/Makefile
@@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat
LDLIBS += -ldevinfo -lkstat -lavl
CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR}
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 0555
lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR)
diff --git a/usr/src/cmd/stat/vmstat/Makefile b/usr/src/cmd/stat/vmstat/Makefile
index 3257070752..d6f65b98d0 100644
--- a/usr/src/cmd/stat/vmstat/Makefile
+++ b/usr/src/cmd/stat/vmstat/Makefile
@@ -32,6 +32,9 @@ include $(SRC)/cmd/stat/Makefile.stat
LDLIBS += -ldevinfo -lkstat -lavl
CFLAGS += $(CCVERBOSE) -I${STATCOMMONDIR}
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 0555
lint := LINTFLAGS = -muxs -I$(STATCOMMONDIR)
diff --git a/usr/src/cmd/stmfadm/Makefile b/usr/src/cmd/stmfadm/Makefile
index ff2f191566..548ab3bf0c 100644
--- a/usr/src/cmd/stmfadm/Makefile
+++ b/usr/src/cmd/stmfadm/Makefile
@@ -38,8 +38,9 @@ OBJS = $(LOCAL_OBJS) $(COMMON_OBJS)
SRCS = $(LOCAL_SRCS) $(COMMON_SRCS)
POFILE = stmfadm_all.po
POFILES = $(LOCAL_OBJS:%.o=%.po) $(COMMON_OBJS:%.o=$(COMMONBASE)/cmdparse/%.po)
-
+
CPPFLAGS += -I. -I$(COMMONBASE)/cmdparse
+CERRWARN += -_gcc=-Wno-unused-label
LDLIBS += -lstmf
LINTFLAGS += -xerroff=E_BAD_FORMAT_STR2
diff --git a/usr/src/cmd/stmsboot/Makefile b/usr/src/cmd/stmsboot/Makefile
index ab97b566c2..8e97f0f467 100644
--- a/usr/src/cmd/stmsboot/Makefile
+++ b/usr/src/cmd/stmsboot/Makefile
@@ -40,6 +40,7 @@ ROOTFSLIB_MPXIO = $(ROOT)/lib/mpxio
ROOTMANIFESTDIR = $(ROOTSVCSYSTEMDEVICE)
LDLIBS += -ldevinfo -ldevid -lnvpair -lumem
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/streams/log/Makefile b/usr/src/cmd/streams/log/Makefile
index c3f397ed68..67909774a1 100644
--- a/usr/src/cmd/streams/log/Makefile
+++ b/usr/src/cmd/streams/log/Makefile
@@ -27,6 +27,7 @@ PROG= strace strerr strclean
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
FILEMODE= 0555
diff --git a/usr/src/cmd/streams/strcmd/Makefile b/usr/src/cmd/streams/strcmd/Makefile
index 4196ca1b45..ce0aa9f71e 100644
--- a/usr/src/cmd/streams/strcmd/Makefile
+++ b/usr/src/cmd/streams/strcmd/Makefile
@@ -26,6 +26,8 @@ PROG= strchg strconf
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/strings/Makefile.com b/usr/src/cmd/strings/Makefile.com
index 5aee1b058d..36fc42dd15 100644
--- a/usr/src/cmd/strings/Makefile.com
+++ b/usr/src/cmd/strings/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
-#
PROG= strings
SRCS= ../$(PROG).c
@@ -34,6 +32,8 @@ LDLIBS += -lelf
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/su/Makefile b/usr/src/cmd/su/Makefile
index 6eb13dd6df..031ebc0740 100644
--- a/usr/src/cmd/su/Makefile
+++ b/usr/src/cmd/su/Makefile
@@ -54,6 +54,8 @@ LINTFLAGS += -DDYNAMIC_SU
CLOBBERFILES += $(ROOTFS_PROG) $(EMB_PROG)
+CERRWARN += -_gcc=-Wno-parentheses
+
lint := LDLIBS += -lbsm -lpam -lsecdb
.KEEP_STATE:
diff --git a/usr/src/cmd/sunpc/other/Makefile b/usr/src/cmd/sunpc/other/Makefile
index 8e8e9956cf..b5434c8597 100644
--- a/usr/src/cmd/sunpc/other/Makefile
+++ b/usr/src/cmd/sunpc/other/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
# cmd/sunpc/other/Makefile
@@ -31,6 +29,10 @@ SRCS= ${PROG:%=%.c}
include ../../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/svc/configd/Makefile b/usr/src/cmd/svc/configd/Makefile
index 6f4da5b248..c6f2000e8c 100644
--- a/usr/src/cmd/svc/configd/Makefile
+++ b/usr/src/cmd/svc/configd/Makefile
@@ -50,7 +50,13 @@ ROOTCMDDIR= $(ROOT)/lib/svc/bin
MYCPPFLAGS = -I. -I../common -I../../../common/svc -I$(ROOT)/usr/include/sqlite -D_REENTRANT
CPPFLAGS += $(MYCPPFLAGS)
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
MYLDLIBS = -lumem -luutil -lbsm
LDLIBS += -lsecdb $(MYLDLIBS)
LINTFLAGS += -errtags -erroff=E_BAD_FORMAT_ARG_TYPE2 -erroff=E_NAME_DEF_NOT_USED2
diff --git a/usr/src/cmd/svc/lsvcrun/Makefile b/usr/src/cmd/svc/lsvcrun/Makefile
index 545d70149f..4eda2674db 100644
--- a/usr/src/cmd/svc/lsvcrun/Makefile
+++ b/usr/src/cmd/svc/lsvcrun/Makefile
@@ -23,7 +23,6 @@
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#ident "%Z%%M% %I% %E% SMI"
PROG = lsvcrun
OBJS = lsvcrun.o
@@ -35,6 +34,8 @@ ROOTLIBSVCBINPROG = $(ROOT)/lib/svc/bin/$(PROG)
include ../../Makefile.cmd
LDLIBS += -lcontract -lscf -luutil
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
lint := LINTFLAGS = -ux
diff --git a/usr/src/cmd/svc/mfstscan/Makefile b/usr/src/cmd/svc/mfstscan/Makefile
index a0783bf3d3..5a24abb0ca 100644
--- a/usr/src/cmd/svc/mfstscan/Makefile
+++ b/usr/src/cmd/svc/mfstscan/Makefile
@@ -44,6 +44,9 @@ CPPFLAGS += -I../common
LDLIBS += -lscf -luutil -lmd5
CLOBBERFILES += $(POFILES)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+
lint := LINTFLAGS = -ux -erroff=E_GLOBAL_COULD_BE_STATIC2
.KEEP_STATE:
diff --git a/usr/src/cmd/svc/startd/Makefile b/usr/src/cmd/svc/startd/Makefile
index 1df70d64dd..1a29300a68 100644
--- a/usr/src/cmd/svc/startd/Makefile
+++ b/usr/src/cmd/svc/startd/Makefile
@@ -63,9 +63,14 @@ include ../../Makefile.ctf
ROOTCMDDIR= $(ROOT)/lib/svc/bin
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
CPPFLAGS += -I. -I../common
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
$(OBJS) := CPPFLAGS += -D_FILE_OFFSET_BITS=64 -D_REENTRANT
proc.o := CPPFLAGS += -D_REENTRANT
diff --git a/usr/src/cmd/svc/svcadm/Makefile b/usr/src/cmd/svc/svcadm/Makefile
index 8b024e20da..1a6a0dd35c 100644
--- a/usr/src/cmd/svc/svcadm/Makefile
+++ b/usr/src/cmd/svc/svcadm/Makefile
@@ -34,6 +34,9 @@ include ../../Makefile.cmd
POFILE = $(PROG)_all.po
LDLIBS += -lscf -luutil -lcontract
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+
lint := LINTFLAGS = -ux
.KEEP_STATE:
diff --git a/usr/src/cmd/svc/svccfg/Makefile b/usr/src/cmd/svc/svccfg/Makefile
index 6d613ffa7a..d5a6e434d6 100644
--- a/usr/src/cmd/svc/svccfg/Makefile
+++ b/usr/src/cmd/svc/svccfg/Makefile
@@ -73,6 +73,13 @@ MYCPPFLAGS = -I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
CPPFLAGS += $(MYCPPFLAGS)
LDFLAGS += $(MAPOPTS)
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+
LFLAGS = -t
YFLAGS = -d
diff --git a/usr/src/cmd/svc/svcprop/Makefile b/usr/src/cmd/svc/svcprop/Makefile
index af09f6555d..4e1f4d4981 100644
--- a/usr/src/cmd/svc/svcprop/Makefile
+++ b/usr/src/cmd/svc/svcprop/Makefile
@@ -35,6 +35,8 @@ LDLIBS += -lscf -luutil
lint := LINTFLAGS = -ux
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/svc/svcs/Makefile b/usr/src/cmd/svc/svcs/Makefile
index 7d0085b64e..0e9fc52652 100644
--- a/usr/src/cmd/svc/svcs/Makefile
+++ b/usr/src/cmd/svc/svcs/Makefile
@@ -38,6 +38,9 @@ LDLIBS += -lcontract -lscf -luutil -lumem -lnvpair -lzonecfg
CPPFLAGS += -I ../common
lint := LINTFLAGS = -mux
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/svr4pkg/Makefile.svr4pkg b/usr/src/cmd/svr4pkg/Makefile.svr4pkg
index f7d3462665..89c4854e39 100644
--- a/usr/src/cmd/svr4pkg/Makefile.svr4pkg
+++ b/usr/src/cmd/svr4pkg/Makefile.svr4pkg
@@ -33,6 +33,14 @@ CPPFLAGS += -I$(SRC)/cmd/svr4pkg/hdrs \
-D_FILE_OFFSET_BITS=64
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-address
+
LIBINST = $(SRC)/cmd/svr4pkg/libinst/libinst.a
SRCS= $(OBJS:.o=.c)
diff --git a/usr/src/cmd/svr4pkg/libinst/Makefile b/usr/src/cmd/svr4pkg/libinst/Makefile
index ea6117dc58..89823b854d 100644
--- a/usr/src/cmd/svr4pkg/libinst/Makefile
+++ b/usr/src/cmd/svr4pkg/libinst/Makefile
@@ -61,6 +61,12 @@ CPPFLAGS += -I$(SRC)/cmd/svr4pkg/hdrs \
#
LINTFLAGS += -un
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-unused-variable
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/swap/Makefile.com b/usr/src/cmd/swap/Makefile.com
index 451fb51b65..3734d8ac58 100644
--- a/usr/src/cmd/swap/Makefile.com
+++ b/usr/src/cmd/swap/Makefile.com
@@ -33,6 +33,7 @@ include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
CPPFLAGS += -D_LARGEFILE64_SOURCE
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
FILEMODE=02555
diff --git a/usr/src/cmd/sysdef/Makefile.com b/usr/src/cmd/sysdef/Makefile.com
index df73086429..05ded4a1c8 100644
--- a/usr/src/cmd/sysdef/Makefile.com
+++ b/usr/src/cmd/sysdef/Makefile.com
@@ -30,6 +30,7 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
LDLIBS += -ldevinfo -lelf
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 02555
diff --git a/usr/src/cmd/syseventadm/Makefile b/usr/src/cmd/syseventadm/Makefile
index 95a3a0fdc3..91c515b00f 100644
--- a/usr/src/cmd/syseventadm/Makefile
+++ b/usr/src/cmd/syseventadm/Makefile
@@ -32,6 +32,7 @@ OBJS = $(PROG).o
include ../Makefile.cmd
FILEMODE= 0555
+CERRWARN += -_gcc=-Wno-uninitialized
POFILES = $(SRCS:.c=.po)
diff --git a/usr/src/cmd/syseventd/daemons/syseventd/Makefile b/usr/src/cmd/syseventd/daemons/syseventd/Makefile
index 310736ba03..b599ae9560 100644
--- a/usr/src/cmd/syseventd/daemons/syseventd/Makefile
+++ b/usr/src/cmd/syseventd/daemons/syseventd/Makefile
@@ -23,14 +23,14 @@
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = syseventd
SRCS = syseventd.c sysevent_signal.c sysevent_client.c
include ../Makefile.com
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile b/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile
index 0385e82cc5..164b6c1acf 100644
--- a/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile
+++ b/usr/src/cmd/syseventd/modules/devfsadmd_mod/Makefile
@@ -20,19 +20,16 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 2001 by Sun Microsystems, Inc.
# All rights reserved.
#
-# cmd/syseventd/modules/devfsadmd_mod/Makefile
-#
LIBRARY = devfsadmd_mod
include ../Makefile.com
CPPFLAGS += -I $(SRC)/cmd/devfsadm
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile
index d778082424..377c91df68 100644
--- a/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile
+++ b/usr/src/cmd/syseventd/modules/sysevent_conf_mod/Makefile
@@ -19,13 +19,9 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2008 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# cmd/syseventd/modules/sysevent_conf_mod/Makefile
-#
LIBRARY = sysevent_conf_mod
@@ -34,6 +30,8 @@ include ../Makefile.com
LDLIBS += -lnvpair
CPPFLAGS += -I ../../daemons/syseventconfd
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(DYNLIB)
diff --git a/usr/src/cmd/syseventd/modules/zfs_mod/Makefile b/usr/src/cmd/syseventd/modules/zfs_mod/Makefile
index ad550e28dc..13dcc10c90 100644
--- a/usr/src/cmd/syseventd/modules/zfs_mod/Makefile
+++ b/usr/src/cmd/syseventd/modules/zfs_mod/Makefile
@@ -29,6 +29,8 @@ include ../Makefile.com
CPPFLAGS += -I../../../../lib/libc/inc
LDLIBS += -lzfs -ldevid -lcmdutils -lnvpair
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(DYNLIB)
diff --git a/usr/src/cmd/syslogd/Makefile.com b/usr/src/cmd/syslogd/Makefile.com
index 0005ab31ba..93b2a94dd4 100644
--- a/usr/src/cmd/syslogd/Makefile.com
+++ b/usr/src/cmd/syslogd/Makefile.com
@@ -34,7 +34,7 @@ LLOBJS= $(OBJS:%.o=%.ll)
include ../../Makefile.cmd
$(PROG) lint := LDLIBS += -lscf -lnsl
-CCVERBOSE =
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
CFLAGS += -DNDEBUG
diff --git a/usr/src/cmd/tabs/Makefile b/usr/src/cmd/tabs/Makefile
index c59a187d44..9a5e534cc4 100644
--- a/usr/src/cmd/tabs/Makefile
+++ b/usr/src/cmd/tabs/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,6 +30,8 @@ include ../Makefile.cmd
LDLIBS += -lcurses
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-address
.KEEP_STATE:
diff --git a/usr/src/cmd/tar/Makefile b/usr/src/cmd/tar/Makefile
index 5af64596d0..5da69ec0f9 100644
--- a/usr/src/cmd/tar/Makefile
+++ b/usr/src/cmd/tar/Makefile
@@ -37,6 +37,9 @@ LINTFLAGS += -u
LDLIBS += -lsec -lcmdutils -lnvpair -ltsol
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -DEUC
diff --git a/usr/src/cmd/tbl/Makefile b/usr/src/cmd/tbl/Makefile
index 309ccfdc92..8213f9bf01 100644
--- a/usr/src/cmd/tbl/Makefile
+++ b/usr/src/cmd/tbl/Makefile
@@ -20,12 +20,8 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/tbl/Makefile
-#
include ../Makefile.cmd
@@ -40,6 +36,11 @@ OBJS = $(SRCS:%.c=%.o)
POFILES= $(OBJS:%.o=%.po)
POFILE= tbl.po
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-char-subscripts
+
.KEEP_STATE :
all : $(PROG)
diff --git a/usr/src/cmd/tcopy/Makefile b/usr/src/cmd/tcopy/Makefile
index a29584eb18..d5813abe94 100644
--- a/usr/src/cmd/tcopy/Makefile
+++ b/usr/src/cmd/tcopy/Makefile
@@ -20,17 +20,17 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1990 by Sun Microsystems, Inc.
#
-# Makefile for cmd/tcopy
-#
PROG = tcopy
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-extra
.KEEP_STATE :
diff --git a/usr/src/cmd/tcpd/Makefile b/usr/src/cmd/tcpd/Makefile
index ab1318c55e..ec4d3c4876 100644
--- a/usr/src/cmd/tcpd/Makefile
+++ b/usr/src/cmd/tcpd/Makefile
@@ -9,10 +9,7 @@ PROG= safe_finger tcpd tcpdchk tcpdmatch try-from
include ../Makefile.cmd
-ERROFF= -erroff=E_FUNC_HAS_NO_RETURN_STMT \
- -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \
- -_gcc=-Wno-return-type -_gcc=-Wno-implicit
-CFLAGS += $(CCVERBOSE) $(ERROFF)
+CFLAGS += $(CCVERBOSE)
CPPFLAGS += $(ACCESS) $(PARANOID) $(NETGROUP) $(TLI) \
$(UMASK) $(STYLE) $(TABLES) $(KILL_OPT) $(BUGS) \
-DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
@@ -23,6 +20,15 @@ tcpd tcpdmatch try-from := \
LDLIBS += -lwrap
tcpdchk := LDLIBS += -lwrap -lnsl
+CERRWARN += -erroff=E_FUNC_HAS_NO_RETURN_STMT
+CERRWARN += -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-return-type
+CERRWARN += -_gcc=-Wno-clobbered
+
# Various components must export interfaces, but also contain name-space
# clashes with system libraries.
MAPFILE.INT.D= $(MAPFILE.NGB) mapfile-intf-tcpdchk
diff --git a/usr/src/cmd/th_tools/Makefile b/usr/src/cmd/th_tools/Makefile
index b2eb73cfe5..c57e71e622 100644
--- a/usr/src/cmd/th_tools/Makefile
+++ b/usr/src/cmd/th_tools/Makefile
@@ -32,6 +32,8 @@ CFLAGS += -I$(SRC)/uts/common
LINTFLAGS += -I$(SRC)/uts/common
C99MODE= $(C99_ENABLE)
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
SRCS = $(PROG:%=%.c)
OBJECTS = $(SRCS:%.c=%.o)
diff --git a/usr/src/cmd/tic/Makefile b/usr/src/cmd/tic/Makefile
index a27787d06a..e4d3c127b1 100644
--- a/usr/src/cmd/tic/Makefile
+++ b/usr/src/cmd/tic/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -45,6 +43,11 @@ CPPFLAGS += -I../../lib/libcurses/screen
MAPFILES = $(MAPFILE.INT) $(MAPFILE.NGB)
LDFLAGS += $(MAPFILES:%=-M%)
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/tip/Makefile b/usr/src/cmd/tip/Makefile
index 0c04dc41fd..0aaeb39d1e 100644
--- a/usr/src/cmd/tip/Makefile
+++ b/usr/src/cmd/tip/Makefile
@@ -60,6 +60,9 @@ $(ROOTACULOG) := FILEMODE = 600
LINTFLAGS += -u
CPPFLAGS += -DDEFBR=300 -DDEFFS=BUFSIZ -DACULOG -DUSG
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-uninitialized
CONFIG= -DV831 -DVENTEL -DV3451 -DDF02 -DDF03 -DBIZ1031 -DBIZ1022 -DHAYES
ACULIB= aculib/aculib.a
LDLIBS= $(ACULIB) $(LDLIBS.cmd)
diff --git a/usr/src/cmd/tip/aculib/Makefile b/usr/src/cmd/tip/aculib/Makefile
index 4b35f0edca..c31175daff 100644
--- a/usr/src/cmd/tip/aculib/Makefile
+++ b/usr/src/cmd/tip/aculib/Makefile
@@ -6,8 +6,7 @@
# All rights reserved. The Berkeley software License Agreement
# specifies the terms and conditions for redistribution.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
+
# make file for tip device drivers
#
# Current drivers:
@@ -28,6 +27,8 @@ include ../../Makefile.cmd
LINTFLAGS += -u
CPPFLAGS= -I../ -DUSG $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/tnf/prex/Makefile.com b/usr/src/cmd/tnf/prex/Makefile.com
index b6ea70d2dc..6a25466978 100644
--- a/usr/src/cmd/tnf/prex/Makefile.com
+++ b/usr/src/cmd/tnf/prex/Makefile.com
@@ -19,8 +19,7 @@
#
# CDDL HEADER END
#
-#
-#ident "%Z%%M% %I% %E% SMI"
+
#
# Copyright 1989,2003 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
@@ -65,7 +64,13 @@ LFLAGS= -v
# FOR normal makefile, uncomment the next line
LDLIBS += -lgen -ltnfctl -lelf -lc
# Uncomment the following line for a debug build
-# COPTFLAG = -g -DDEBUG -v
+# COPTFLAG = -g -DDEBUG
+
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/tnf/tnfxtract/Makefile.com b/usr/src/cmd/tnf/tnfxtract/Makefile.com
index 747f5030f1..3916b9ca6f 100644
--- a/usr/src/cmd/tnf/tnfxtract/Makefile.com
+++ b/usr/src/cmd/tnf/tnfxtract/Makefile.com
@@ -23,8 +23,6 @@
# Copyright 1994, 2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG= tnfxtract
@@ -38,6 +36,7 @@ include ../../../Makefile.cmd
LFLAGS= -v
LDLIBS += -lkvm
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/tput/Makefile b/usr/src/cmd/tput/Makefile
index ac90caaecd..80cd77e8f1 100644
--- a/usr/src/cmd/tput/Makefile
+++ b/usr/src/cmd/tput/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -33,6 +31,7 @@ include ../Makefile.cmd
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
XGETFLAGS += -a -x tput.xcl
LDLIBS += -lcurses
diff --git a/usr/src/cmd/tput/tput.c b/usr/src/cmd/tput/tput.c
index 18dce8d6cb..c8a61cc2ee 100644
--- a/usr/src/cmd/tput/tput.c
+++ b/usr/src/cmd/tput/tput.c
@@ -22,6 +22,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright (c) 2012 Gary Mills
*/
/* Copyright (c) 1988 AT&T */
@@ -174,10 +175,12 @@ main(int argc, char **argv)
for (i = 0; i < 10; i++)
v[i] = (char *)malloc(32 * sizeof (char));
- while (gets(buff) != NULL) {
+ while (fgets(buff, sizeof (buff), stdin) != NULL) {
/* read standard input line; skip over empty lines */
if ((std_argc =
- sscanf(buff, "%s %s %s %s %s %s %s %s %s %s",
+ sscanf(buff,
+ "%31s %31s %31s %31s %31s %31s %31s %31s "
+ "%31s %31s",
v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7],
v[8], v[9])) < 1) {
continue;
diff --git a/usr/src/cmd/trapstat/sun4/Makefile b/usr/src/cmd/trapstat/sun4/Makefile
index a69c5e6af3..8c48d97ad2 100644
--- a/usr/src/cmd/trapstat/sun4/Makefile
+++ b/usr/src/cmd/trapstat/sun4/Makefile
@@ -34,6 +34,7 @@ EXTOBJS = ../capabilities/sun4u/symcap.o \
CPPFLAGS += -I$(SRC)/uts/sun4 -I.
LINTFLAGS += -erroff=E_SEC_PRINTF_VAR_FMT
+CERRWARN += -_gcc=-Wno-clobbered
.KEEP_STATE:
@@ -47,7 +48,7 @@ $(PROG): $(OBJS) $(EXTOBJS)
clean:
$(RM) $(OBJS) $(EXTOBJS)
-
+
lint: lint_PROG
include $(SRC)/cmd/Makefile.targ
diff --git a/usr/src/cmd/troff/nroff.d/Makefile b/usr/src/cmd/troff/nroff.d/Makefile
index 6d991447f2..295dcfb704 100644
--- a/usr/src/cmd/troff/nroff.d/Makefile
+++ b/usr/src/cmd/troff/nroff.d/Makefile
@@ -20,12 +20,8 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/troff/nroff.d/Makefile
-#
include ../../Makefile.cmd
@@ -43,6 +39,12 @@ SRCS = $(OBJS:%.o=%.c) $(COMMONOBJS:%.o=../%.c)
CPPFLAGS = -DNROFF -DUSG -DINCORE -DEUC -I. -I.. $(CPPFLAGS.master)
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+
LDLIBS += -lmapmalloc
#
# message catalog
diff --git a/usr/src/cmd/troff/troff.d/Makefile b/usr/src/cmd/troff/troff.d/Makefile
index 475a1718c0..e94bea647d 100644
--- a/usr/src/cmd/troff/troff.d/Makefile
+++ b/usr/src/cmd/troff/troff.d/Makefile
@@ -43,6 +43,13 @@ SRCS = $(TAOBJS:%.o=%.c) $(MAKEDEVOBJS:%.o=%.c) \
TXTS = README maketables troff.sh
CPPFLAGS = -DUSG -DINCORE -I. -I.. $(CPPFLAGS.master)
+
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-extra
+
#
# For message catalog
#
@@ -93,7 +100,7 @@ $(POFILE): $(POFILES)
strip :
$(STRIP $(PROG)
-
+
lint : lint_SRCS
include ../../Makefile.targ
diff --git a/usr/src/cmd/truss/Makefile.com b/usr/src/cmd/truss/Makefile.com
index 0590cce251..b500283399 100644
--- a/usr/src/cmd/truss/Makefile.com
+++ b/usr/src/cmd/truss/Makefile.com
@@ -38,6 +38,9 @@ include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+
C99MODE= $(C99_ENABLE)
LDLIBS += -lproc -lrtld_db -lc_db -lnsl -lsocket -ltsol -lnvpair
diff --git a/usr/src/cmd/tsol/tnctl/Makefile b/usr/src/cmd/tsol/tnctl/Makefile
index cbb8cf16a0..71cb5f5a95 100644
--- a/usr/src/cmd/tsol/tnctl/Makefile
+++ b/usr/src/cmd/tsol/tnctl/Makefile
@@ -37,6 +37,9 @@ $(ROOTMANIFEST) := FILEMODE= 444
LDLIBS += -lnsl -ltsnet
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/tsol/tnd/Makefile b/usr/src/cmd/tsol/tnd/Makefile
index 3d7d9d7794..247a680358 100644
--- a/usr/src/cmd/tsol/tnd/Makefile
+++ b/usr/src/cmd/tsol/tnd/Makefile
@@ -44,6 +44,9 @@ LDLIBS += -lnsl -ltsnet
CPPFLAGS += $(IFLAGS)
CPPFLAGS += -DDEBUG
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/tsol/updatehome/Makefile b/usr/src/cmd/tsol/updatehome/Makefile
index ed3ca8c04b..5651d36d99 100644
--- a/usr/src/cmd/tsol/updatehome/Makefile
+++ b/usr/src/cmd/tsol/updatehome/Makefile
@@ -24,10 +24,6 @@
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
-
-#
# cmd/tsol/updatehome
#
PROG= updatehome
@@ -38,6 +34,7 @@ OBJS= setupfiles.o updatehome.o
SRCS= $(OBJS:%.o=%.c)
LDLIBS += -ltsol -lsecdb
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/ttymon/Makefile b/usr/src/cmd/ttymon/Makefile
index abe863d46f..854e5e8d95 100644
--- a/usr/src/cmd/ttymon/Makefile
+++ b/usr/src/cmd/ttymon/Makefile
@@ -73,6 +73,11 @@ LINTFLAGS = -b -x
CFLAGS += $(CCVERBOSE)
LDFLAGS += $(MAPFILE.NGB:%=-M%)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-extra
+
#
# Message catalog
#
diff --git a/usr/src/cmd/ucodeadm/Makefile b/usr/src/cmd/ucodeadm/Makefile
index 1155f50081..1fb1938265 100644
--- a/usr/src/cmd/ucodeadm/Makefile
+++ b/usr/src/cmd/ucodeadm/Makefile
@@ -45,7 +45,9 @@ ROOTINTELUCODE = $(INTEL_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
ROOTAMDUCODE = $(AMD_UCODE_FILE:%=$(ROOTUCODEPATH)/%)
CPPFLAGS = -I../../common -I../../uts/common
-CFLAGS += -v
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-type-limits
LINTFLAGS += -errtags -erroff=E_NAME_DEF_NOT_USED2
LINTFLAGS += -erroff=E_INCONS_ARG_DECL2,E_INCONS_VAL_TYPE_DECL2
LDLIBS = -lgen
diff --git a/usr/src/cmd/uname/Makefile b/usr/src/cmd/uname/Makefile
index 723e597cc0..daa11b4aa8 100644
--- a/usr/src/cmd/uname/Makefile
+++ b/usr/src/cmd/uname/Makefile
@@ -28,6 +28,7 @@ ROOTFS_PROG= $(PROG)
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/units/Makefile b/usr/src/cmd/units/Makefile
index 8071ad08a1..b6455296de 100644
--- a/usr/src/cmd/units/Makefile
+++ b/usr/src/cmd/units/Makefile
@@ -20,8 +20,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
@@ -30,6 +28,9 @@ UNITTAB=unittab
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
LIBUNITTAB= $(UNITTAB:%=$(ROOTSHLIB)/%)
$(LIBUNITTAB) := FILEMODE = $(LIBFILEMODE)
diff --git a/usr/src/cmd/unlink/Makefile b/usr/src/cmd/unlink/Makefile
index 1a2c6d59bc..78cb745acd 100644
--- a/usr/src/cmd/unlink/Makefile
+++ b/usr/src/cmd/unlink/Makefile
@@ -27,6 +27,8 @@ PROG= unlink
include ../Makefile.cmd
FILEMODE = 0555
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE:
diff --git a/usr/src/cmd/unpack/Makefile b/usr/src/cmd/unpack/Makefile
index 31e0e24556..bb3fc4e9e8 100644
--- a/usr/src/cmd/unpack/Makefile
+++ b/usr/src/cmd/unpack/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -29,6 +27,8 @@ PROG= unpack
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
CPPFLAGS += -D_FILE_OFFSET_BITS=64
LDLIBS += -lcmdutils -lsec
diff --git a/usr/src/cmd/users/Makefile b/usr/src/cmd/users/Makefile
index 78887bc15e..253af50ff5 100644
--- a/usr/src/cmd/users/Makefile
+++ b/usr/src/cmd/users/Makefile
@@ -19,9 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
-#
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -32,6 +29,9 @@ SRCS= $(OBJS:%.o=%.c)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/utmpd/Makefile b/usr/src/cmd/utmpd/Makefile
index ecb124120c..f1b2a4222e 100644
--- a/usr/src/cmd/utmpd/Makefile
+++ b/usr/src/cmd/utmpd/Makefile
@@ -34,6 +34,8 @@ ROOTMANIFESTDIR = $(ROOTSVCSYSTEM)
FILEMODE = 555
+CERRWARN += -_gcc=-Wno-extra
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/vgrind/Makefile b/usr/src/cmd/vgrind/Makefile
index 2d58bb0c16..0bb0619aa2 100644
--- a/usr/src/cmd/vgrind/Makefile
+++ b/usr/src/cmd/vgrind/Makefile
@@ -61,6 +61,11 @@ CLOBBERFILES= $(LIBPROG) $(RETEST)
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-function
+
#
# Message catalog
#
diff --git a/usr/src/cmd/vi/misc/Makefile b/usr/src/cmd/vi/misc/Makefile
index 5d88cceb8b..d124adae63 100644
--- a/usr/src/cmd/vi/misc/Makefile
+++ b/usr/src/cmd/vi/misc/Makefile
@@ -20,11 +20,8 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# cmd/vi/misc/Makefile
CFLAGS += v
@@ -41,6 +38,12 @@ POFILES= $(SRCS:%.c=%.po)
include ../../Makefile.cmd
$(XPG4) := CFLAGS += -DXPG4
+CERRWARN += -_gcc=-Wno-char-subscripts
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+
POFILE= misc.po
CLOBBERFILES += $(OTHERPROGS)
diff --git a/usr/src/cmd/vi/port/Makefile b/usr/src/cmd/vi/port/Makefile
index 8bb0e5f1b5..8e223d98e8 100644
--- a/usr/src/cmd/vi/port/Makefile
+++ b/usr/src/cmd/vi/port/Makefile
@@ -51,6 +51,16 @@ TXTS = READ_ME makeoptions asfix.c70 ex.news port.mk.370 port.mk.70 \
port.mk.c70 port.mk.usg ovdoprnt.s ovprintf.c rofix
include ../../Makefile.cmd
+
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-clobbered
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-value
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-address
+
#
# For message catalogue files
#
diff --git a/usr/src/cmd/volcheck/Makefile b/usr/src/cmd/volcheck/Makefile
index fb82067395..762dd50c9b 100644
--- a/usr/src/cmd/volcheck/Makefile
+++ b/usr/src/cmd/volcheck/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = volcheck
LOCAL_OBJS = volcheck.o
@@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal
CPPFLAGS += -I$(SRC)/cmd/rmvolmgr
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/volrmmount/Makefile b/usr/src/cmd/volrmmount/Makefile
index 0c0b6c7fdb..5166036a04 100644
--- a/usr/src/cmd/volrmmount/Makefile
+++ b/usr/src/cmd/volrmmount/Makefile
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = volrmmount
LOCAL_OBJS = volrmmount.o
@@ -43,6 +41,12 @@ CPPFLAGS += -I$(ROOT)/usr/include/hal
CPPFLAGS += -I$(SRC)/cmd/rmvolmgr
C99MODE = $(C99_ENABLE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-function
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/vrrpadm/Makefile b/usr/src/cmd/vrrpadm/Makefile
index a7631e7d09..c63a09589d 100644
--- a/usr/src/cmd/vrrpadm/Makefile
+++ b/usr/src/cmd/vrrpadm/Makefile
@@ -30,6 +30,8 @@ include ../Makefile.cmd
XGETFLAGS += -a -x $(PROG).xcl
LDLIBS += -lvrrpadm -lnsl -linetutil
+CERRWARN += -_gcc=-Wno-unused-label
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/vscan/vscand/Makefile b/usr/src/cmd/vscan/vscand/Makefile
index 32c1a73da7..15ff0086c2 100755..100644
--- a/usr/src/cmd/vscan/vscand/Makefile
+++ b/usr/src/cmd/vscan/vscand/Makefile
@@ -22,8 +22,6 @@
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-#
-#ident "%Z%%M% %I% %E% SMI"
PROG = vscand
SRCS = vs_main.c \
@@ -46,6 +44,8 @@ CFLAGS += $(CCVERBOSE)
CFLAGS += -D_FILE_OFFSET_BITS=64
$(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
+CERRWARN += -_gcc=-Wno-switch
+
LINTFLAGS += -mu
C99MODE = -xc99=%all
C99LMODE = -Xc99=%all
diff --git a/usr/src/cmd/vt/Makefile b/usr/src/cmd/vt/Makefile
index b7a1c63cdd..48fa393153 100644
--- a/usr/src/cmd/vt/Makefile
+++ b/usr/src/cmd/vt/Makefile
@@ -31,6 +31,7 @@ VTINFO_SRC= vtinfo.c
include ../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-uninitialized
LDLIBS += -lpam -lbsm
diff --git a/usr/src/cmd/w/amd64/Makefile b/usr/src/cmd/w/amd64/Makefile
index 8e80f8c4b1..539860f566 100644
--- a/usr/src/cmd/w/amd64/Makefile
+++ b/usr/src/cmd/w/amd64/Makefile
@@ -33,6 +33,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
ROOTLINK= $(ROOTBIN64)/uptime
diff --git a/usr/src/cmd/w/i386/Makefile b/usr/src/cmd/w/i386/Makefile
index 7e806136fc..55a9b448c2 100644
--- a/usr/src/cmd/w/i386/Makefile
+++ b/usr/src/cmd/w/i386/Makefile
@@ -33,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
lint := LINTFLAGS = -x
diff --git a/usr/src/cmd/w/sparcv9/Makefile b/usr/src/cmd/w/sparcv9/Makefile
index a83b770b3c..0a72a73af1 100644
--- a/usr/src/cmd/w/sparcv9/Makefile
+++ b/usr/src/cmd/w/sparcv9/Makefile
@@ -34,6 +34,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
lint := LINTFLAGS64 = -x -m64
diff --git a/usr/src/cmd/wall/Makefile b/usr/src/cmd/wall/Makefile
index e338057768..344209d5a7 100644
--- a/usr/src/cmd/wall/Makefile
+++ b/usr/src/cmd/wall/Makefile
@@ -31,6 +31,8 @@ include ../Makefile.cmd
FILEMODE = 02555
LDLIBS += -lzonecfg -lcontract
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/whodo/amd64/Makefile b/usr/src/cmd/whodo/amd64/Makefile
index 59abff4e6d..ca074ce6de 100644
--- a/usr/src/cmd/whodo/amd64/Makefile
+++ b/usr/src/cmd/whodo/amd64/Makefile
@@ -33,6 +33,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
FILEMODE= 04555
diff --git a/usr/src/cmd/whodo/i386/Makefile b/usr/src/cmd/whodo/i386/Makefile
index 71fa35a66d..e40790412d 100644
--- a/usr/src/cmd/whodo/i386/Makefile
+++ b/usr/src/cmd/whodo/i386/Makefile
@@ -33,6 +33,7 @@ SRCS= $(OBJS:%.o=../%.c)
include ../../Makefile.cmd
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
lint := LINTFLAGS = -x
diff --git a/usr/src/cmd/whodo/sparcv9/Makefile b/usr/src/cmd/whodo/sparcv9/Makefile
index bc1ac015a6..a0d41d0f83 100644
--- a/usr/src/cmd/whodo/sparcv9/Makefile
+++ b/usr/src/cmd/whodo/sparcv9/Makefile
@@ -35,6 +35,7 @@ include ../../Makefile.cmd
include ../../Makefile.cmd.64
CFLAGS64 += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-parentheses
lint := LINTFLAGS64 = -x -m64
diff --git a/usr/src/cmd/write/Makefile b/usr/src/cmd/write/Makefile
index 7cd6e710a8..74ffb5e953 100644
--- a/usr/src/cmd/write/Makefile
+++ b/usr/src/cmd/write/Makefile
@@ -36,6 +36,7 @@ XGETFLAGS += -a -x write.xcl
.KEEP_STATE:
CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-unused-variable
all: $(PROG)
diff --git a/usr/src/cmd/xargs/Makefile b/usr/src/cmd/xargs/Makefile
index e6d32e7452..b4e136d8a6 100644
--- a/usr/src/cmd/xargs/Makefile
+++ b/usr/src/cmd/xargs/Makefile
@@ -19,8 +19,6 @@
# CDDL HEADER END
#
#
-#ident "%Z%%M% %I% %E% SMI"
-#
# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
@@ -38,6 +36,8 @@ include ../Makefile.cmd
CPPFLAGS += -I $(SRC)/common/util
LINTFLAGS += -u
+CERRWARN += -_gcc=-Wno-parentheses
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/xstr/Makefile b/usr/src/cmd/xstr/Makefile
index ac50ba07da..c188866ad4 100644
--- a/usr/src/cmd/xstr/Makefile
+++ b/usr/src/cmd/xstr/Makefile
@@ -20,17 +20,14 @@
# CDDL HEADER END
#
#
-# ident "%Z%%M% %I% %E% SMI"
-#
# Copyright (c) 1989 by Sun Microsystems, Inc.
#
-# Makefile for cmd/xstr
-#
PROG = xstr
include ../Makefile.cmd
+CERRWARN += -_gcc=-Wno-parentheses
.KEEP_STATE :
diff --git a/usr/src/cmd/ypcmd/Makefile b/usr/src/cmd/ypcmd/Makefile
index 55cf13f972..ed16123edc 100644
--- a/usr/src/cmd/ypcmd/Makefile
+++ b/usr/src/cmd/ypcmd/Makefile
@@ -141,6 +141,16 @@ INIS2LDAPPROG = $(NIS2LDAPPROG:%=$(NETYP)/%)
NIS2LDAPINC = -I$(SRC)/lib/libnisdb/yptol
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-extra
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-address
+CERRWARN += -_gcc=-Wno-unused-function
+
#conditional assignments
ypalias.o := CPPFLAGS= -DMAIN $(CPPFLAGS.master)
makedbm.o := CPPFLAGS= $(CPPFLAGS.master)
diff --git a/usr/src/cmd/ypcmd/mknetid/Makefile b/usr/src/cmd/ypcmd/mknetid/Makefile
index 97453b068e..e336bef421 100644
--- a/usr/src/cmd/ypcmd/mknetid/Makefile
+++ b/usr/src/cmd/ypcmd/mknetid/Makefile
@@ -23,8 +23,6 @@
# Copyright 1994, 2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = mknetid
@@ -35,6 +33,9 @@ LDLIBS += -lnsl
OBJS = mknetid.o getname.o
SRCS = $(OBJS:.o=.c)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-function
.KEEP_STATE:
diff --git a/usr/src/cmd/ypcmd/revnetgroup/Makefile b/usr/src/cmd/ypcmd/revnetgroup/Makefile
index 174fd0bee0..82a979b837 100644
--- a/usr/src/cmd/ypcmd/revnetgroup/Makefile
+++ b/usr/src/cmd/ypcmd/revnetgroup/Makefile
@@ -23,8 +23,6 @@
# Copyright 1996, 2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG = revnetgroup
@@ -34,6 +32,10 @@ OBJS = revnetgroup.o getgroup.o table.o util.o
SRCS = $(OBJS:.o=.c)
HDRS = getgroup.h table.h util.h
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/ypcmd/yppasswd/Makefile b/usr/src/cmd/ypcmd/yppasswd/Makefile
index 82fc4293dd..1906d7bcf7 100644
--- a/usr/src/cmd/ypcmd/yppasswd/Makefile
+++ b/usr/src/cmd/ypcmd/yppasswd/Makefile
@@ -56,6 +56,10 @@ INETYPPROG= $(NETYPPROG:%=$(NETYP)/%)
COMMONOBJ = yppasswdxdr.o yplckpwdf.o
RPCYPPASSWDDOBJ = yppasswdd.o changepasswd.o
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
#
# Objects shared between all the major components
#
diff --git a/usr/src/cmd/ypcmd/ypupdated/Makefile b/usr/src/cmd/ypcmd/ypupdated/Makefile
index 7f7592c7f0..0fd7bf0e4c 100644
--- a/usr/src/cmd/ypcmd/ypupdated/Makefile
+++ b/usr/src/cmd/ypcmd/ypupdated/Makefile
@@ -52,6 +52,9 @@ OBJS = $(RPCYPUPDATEOBJ)
SRCS = $(OBJS:%.o=%.c)
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+CERRWARN += -_gcc=-Wno-unused-variable
+
#conditional assignments
$(INETSVC) := FILEMODE=555
diff --git a/usr/src/cmd/zdb/Makefile.com b/usr/src/cmd/zdb/Makefile.com
index 0f018b6d6a..353eb61018 100644
--- a/usr/src/cmd/zdb/Makefile.com
+++ b/usr/src/cmd/zdb/Makefile.com
@@ -45,6 +45,8 @@ CFLAGS += $(CCVERBOSE)
CFLAGS64 += $(CCVERBOSE)
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) -DDEBUG
+CERRWARN += -_gcc=-Wno-uninitialized
+
# lint complains about unused _umem_* functions
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
diff --git a/usr/src/cmd/zdb/zdb.c b/usr/src/cmd/zdb/zdb.c
index d462d3f18e..28c7565c19 100644
--- a/usr/src/cmd/zdb/zdb.c
+++ b/usr/src/cmd/zdb/zdb.c
@@ -86,6 +86,7 @@ extern void dump_intent_log(zilog_t *);
uint64_t *zopt_object = NULL;
int zopt_objects = 0;
libzfs_handle_t *g_zfs;
+uint64_t max_inflight = 200;
/*
* These libumem hooks provide a reasonable set of defaults for the allocator's
@@ -108,13 +109,14 @@ usage(void)
{
(void) fprintf(stderr,
"Usage: %s [-CumdibcsDvhLXFPA] [-t txg] [-e [-p path...]] "
- "poolname [object...]\n"
- " %s [-divPA] [-e -p path...] dataset [object...]\n"
- " %s -m [-LXFPA] [-t txg] [-e [-p path...]] "
+ "[-U config] [-M inflight I/Os] poolname [object...]\n"
+ " %s [-divPA] [-e -p path...] [-U config] dataset "
+ "[object...]\n"
+ " %s -m [-LXFPA] [-t txg] [-e [-p path...]] [-U config] "
"poolname [vdev [metaslab...]]\n"
" %s -R [-A] [-e [-p path...]] poolname "
"vdev:offset:size[:flags]\n"
- " %s -S [-PA] [-e [-p path...]] poolname\n"
+ " %s -S [-PA] [-e [-p path...]] [-U config] poolname\n"
" %s -l [-uA] device\n"
" %s -C [-A] [-U config]\n\n",
cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
@@ -161,6 +163,8 @@ usage(void)
(void) fprintf(stderr, " -P print numbers in parseable form\n");
(void) fprintf(stderr, " -t <txg> -- highest txg to use when "
"searching for uberblocks\n");
+ (void) fprintf(stderr, " -M <number of inflight I/Os> -- "
+ "specify the maximum number of checksumming I/Os [default is 200]");
(void) fprintf(stderr, "Specify an option more than once (e.g. -bb) "
"to make only that option verbose\n");
(void) fprintf(stderr, "Default is to dump everything non-verbosely\n");
@@ -2028,6 +2032,45 @@ zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp,
bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
}
+static void
+zdb_blkptr_done(zio_t *zio)
+{
+ spa_t *spa = zio->io_spa;
+ blkptr_t *bp = zio->io_bp;
+ int ioerr = zio->io_error;
+ zdb_cb_t *zcb = zio->io_private;
+ zbookmark_t *zb = &zio->io_bookmark;
+
+ zio_data_buf_free(zio->io_data, zio->io_size);
+
+ mutex_enter(&spa->spa_scrub_lock);
+ spa->spa_scrub_inflight--;
+ cv_broadcast(&spa->spa_scrub_io_cv);
+
+ if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
+ char blkbuf[BP_SPRINTF_LEN];
+
+ zcb->zcb_haderrors = 1;
+ zcb->zcb_errors[ioerr]++;
+
+ if (dump_opt['b'] >= 2)
+ sprintf_blkptr(blkbuf, bp);
+ else
+ blkbuf[0] = '\0';
+
+ (void) printf("zdb_blkptr_cb: "
+ "Got error %d reading "
+ "<%llu, %llu, %lld, %llx> %s -- skipping\n",
+ ioerr,
+ (u_longlong_t)zb->zb_objset,
+ (u_longlong_t)zb->zb_object,
+ (u_longlong_t)zb->zb_level,
+ (u_longlong_t)zb->zb_blkid,
+ blkbuf);
+ }
+ mutex_exit(&spa->spa_scrub_lock);
+}
+
/* ARGSUSED */
static int
zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
@@ -2049,39 +2092,23 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp, arc_buf_t *pbuf,
is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type));
if (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata)) {
- int ioerr;
size_t size = BP_GET_PSIZE(bp);
- void *data = malloc(size);
+ void *data = zio_data_buf_alloc(size);
int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW;
/* If it's an intent log block, failure is expected. */
if (zb->zb_level == ZB_ZIL_LEVEL)
flags |= ZIO_FLAG_SPECULATIVE;
- ioerr = zio_wait(zio_read(NULL, spa, bp, data, size,
- NULL, NULL, ZIO_PRIORITY_ASYNC_READ, flags, zb));
-
- free(data);
+ mutex_enter(&spa->spa_scrub_lock);
+ while (spa->spa_scrub_inflight > max_inflight)
+ cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock);
+ spa->spa_scrub_inflight++;
+ mutex_exit(&spa->spa_scrub_lock);
- if (ioerr && !(flags & ZIO_FLAG_SPECULATIVE)) {
- zcb->zcb_haderrors = 1;
- zcb->zcb_errors[ioerr]++;
+ zio_nowait(zio_read(NULL, spa, bp, data, size,
+ zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb));
- if (dump_opt['b'] >= 2)
- sprintf_blkptr(blkbuf, bp);
- else
- blkbuf[0] = '\0';
-
- (void) printf("zdb_blkptr_cb: "
- "Got error %d reading "
- "<%llu, %llu, %lld, %llx> %s -- skipping\n",
- ioerr,
- (u_longlong_t)zb->zb_objset,
- (u_longlong_t)zb->zb_object,
- (u_longlong_t)zb->zb_level,
- (u_longlong_t)zb->zb_blkid,
- blkbuf);
- }
}
zcb->zcb_readfails = 0;
@@ -2283,6 +2310,18 @@ dump_block_stats(spa_t *spa)
zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb);
+ /*
+ * If we've traversed the data blocks then we need to wait for those
+ * I/Os to complete. We leverage "The Godfather" zio to wait on
+ * all async I/Os to complete.
+ */
+ if (dump_opt['c']) {
+ (void) zio_wait(spa->spa_async_zio_root);
+ spa->spa_async_zio_root = zio_root(spa, NULL, NULL,
+ ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE |
+ ZIO_FLAG_GODFATHER);
+ }
+
if (zcb.zcb_haderrors) {
(void) printf("\nError counts:\n\n");
(void) printf("\t%5s %s\n", "errno", "count");
@@ -3040,7 +3079,7 @@ main(int argc, char **argv)
dprintf_setup(&argc, argv);
- while ((c = getopt(argc, argv, "bcdhilmsuCDRSAFLXevp:t:U:P")) != -1) {
+ while ((c = getopt(argc, argv, "bcdhilmM:suCDRSAFLXevp:t:U:P")) != -1) {
switch (c) {
case 'b':
case 'c':
@@ -3069,6 +3108,15 @@ main(int argc, char **argv)
case 'v':
verbose++;
break;
+ case 'M':
+ max_inflight = strtoull(optarg, NULL, 0);
+ if (max_inflight == 0) {
+ (void) fprintf(stderr, "maximum number "
+ "of inflight I/Os must be greater "
+ "than 0\n");
+ usage();
+ }
+ break;
case 'p':
if (searchdirs == NULL) {
searchdirs = umem_alloc(sizeof (char *),
diff --git a/usr/src/cmd/zfs/Makefile b/usr/src/cmd/zfs/Makefile
index b117b1206e..3007b82213 100644
--- a/usr/src/cmd/zfs/Makefile
+++ b/usr/src/cmd/zfs/Makefile
@@ -53,6 +53,12 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-type-limits
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-old-style-declaration
+
ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
USRLIBFSTYPELINKS = $(LINKPROGS:%=$(USRLIBFSTYPE)/%)
ROOTETCFSTYPELINKS = $(LINKPROGS:%=$(ROOTETCFSTYPE)/%)
diff --git a/usr/src/cmd/zfs/zfs_main.c b/usr/src/cmd/zfs/zfs_main.c
index e34116d7ec..b32b5ab865 100644
--- a/usr/src/cmd/zfs/zfs_main.c
+++ b/usr/src/cmd/zfs/zfs_main.c
@@ -253,7 +253,7 @@ get_usage(zfs_help_t idx)
case HELP_ROLLBACK:
return (gettext("\trollback [-rRf] <snapshot>\n"));
case HELP_SEND:
- return (gettext("\tsend [-DnPpRrv] [-[iI] snapshot] "
+ return (gettext("\tsend [-DnPpRv] [-[iI] snapshot] "
"<snapshot>\n"));
case HELP_SET:
return (gettext("\tset <property=value> "
diff --git a/usr/src/cmd/zic/Makefile b/usr/src/cmd/zic/Makefile
index 06cf5ba052..a2ffc86536 100644
--- a/usr/src/cmd/zic/Makefile
+++ b/usr/src/cmd/zic/Makefile
@@ -31,6 +31,9 @@ ROOTTZSRCD= $(ROOTSHLIB)/zoneinfo/src
ROOTTZTABD= $(ROOTSHLIB)/zoneinfo/tab
DIRS= $(ROOTTZSRCD) $(ROOTTZTABD)
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-uninitialized
+
ROOTLIBTZSRCFILES= $(SRCFILES:%=$(ROOTTZSRCD)/%)
ROOTLIBTZTABFILES= $(TABFILES:%=$(ROOTTZTABD)/%)
ROOTKSHPROG= $(ROOTBIN)/$(KSHPROG)
diff --git a/usr/src/cmd/zinject/Makefile.com b/usr/src/cmd/zinject/Makefile.com
index c1ac4ac922..3a094ba196 100644
--- a/usr/src/cmd/zinject/Makefile.com
+++ b/usr/src/cmd/zinject/Makefile.com
@@ -22,8 +22,6 @@
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
-# ident "%Z%%M% %I% %E% SMI"
-#
PROG:sh= cd ..; basename `pwd`
OBJS= $(PROG).o translate.o
@@ -41,6 +39,9 @@ C99LMODE= -Xc99=%all
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-switch
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/zinject/translate.c b/usr/src/cmd/zinject/translate.c
index 87751e315e..53a38e1ea8 100644
--- a/usr/src/cmd/zinject/translate.c
+++ b/usr/src/cmd/zinject/translate.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
*/
#include <libzfs.h>
@@ -472,6 +473,20 @@ translate_device(const char *pool, const char *device, err_type_t label_type,
&record->zi_guid) == 0);
}
+ /*
+ * Device faults can take on three different forms:
+ * 1). delayed or hanging I/O
+ * 2). zfs label faults
+ * 3). generic disk faults
+ */
+ if (record->zi_timer != 0) {
+ record->zi_cmd = ZINJECT_DELAY_IO;
+ } else if (label_type != TYPE_INVAL) {
+ record->zi_cmd = ZINJECT_LABEL_FAULT;
+ } else {
+ record->zi_cmd = ZINJECT_DEVICE_FAULT;
+ }
+
switch (label_type) {
case TYPE_LABEL_UBERBLOCK:
record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]);
diff --git a/usr/src/cmd/zinject/zinject.c b/usr/src/cmd/zinject/zinject.c
index aff2539a1b..b5c85b459f 100644
--- a/usr/src/cmd/zinject/zinject.c
+++ b/usr/src/cmd/zinject/zinject.c
@@ -20,6 +20,7 @@
*/
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012 by Delphix. All rights reserved.
*/
/*
@@ -600,7 +601,7 @@ main(int argc, char **argv)
}
while ((c = getopt(argc, argv,
- ":aA:b:d:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) {
+ ":aA:b:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) {
switch (c) {
case 'a':
flags |= ZINJECT_FLUSH_ARC;
@@ -626,6 +627,15 @@ main(int argc, char **argv)
case 'd':
device = optarg;
break;
+ case 'D':
+ record.zi_timer = strtoull(optarg, &end, 10);
+ if (errno != 0 || *end != '\0') {
+ (void) fprintf(stderr, "invalid i/o delay "
+ "value: '%s'\n", optarg);
+ usage();
+ return (1);
+ }
+ break;
case 'e':
if (strcasecmp(optarg, "io") == 0) {
error = EIO;
@@ -690,6 +700,7 @@ main(int argc, char **argv)
case 'p':
(void) strlcpy(record.zi_func, optarg,
sizeof (record.zi_func));
+ record.zi_cmd = ZINJECT_PANIC;
break;
case 'q':
quiet = 1;
@@ -763,13 +774,15 @@ main(int argc, char **argv)
argc -= optind;
argv += optind;
+ if (record.zi_duration != 0)
+ record.zi_cmd = ZINJECT_IGNORED_WRITES;
+
if (cancel != NULL) {
/*
* '-c' is invalid with any other options.
*/
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
- level != 0 || record.zi_func[0] != '\0' ||
- record.zi_duration != 0) {
+ level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) {
(void) fprintf(stderr, "cancel (-c) incompatible with "
"any other options\n");
usage();
@@ -801,8 +814,7 @@ main(int argc, char **argv)
* for doing injection, so handle it separately here.
*/
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
- level != 0 || record.zi_func[0] != '\0' ||
- record.zi_duration != 0) {
+ level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) {
(void) fprintf(stderr, "device (-d) incompatible with "
"data error injection\n");
usage();
@@ -836,7 +848,7 @@ main(int argc, char **argv)
} else if (raw != NULL) {
if (range != NULL || type != TYPE_INVAL || level != 0 ||
- record.zi_func[0] != '\0' || record.zi_duration != 0) {
+ record.zi_cmd != ZINJECT_UNINITIALIZED) {
(void) fprintf(stderr, "raw (-b) format with "
"any other options\n");
usage();
@@ -859,13 +871,14 @@ main(int argc, char **argv)
return (1);
}
+ record.zi_cmd = ZINJECT_DATA_FAULT;
if (translate_raw(raw, &record) != 0)
return (1);
if (!error)
error = EIO;
- } else if (record.zi_func[0] != '\0') {
+ } else if (record.zi_cmd == ZINJECT_PANIC) {
if (raw != NULL || range != NULL || type != TYPE_INVAL ||
- level != 0 || device != NULL || record.zi_duration != 0) {
+ level != 0 || device != NULL) {
(void) fprintf(stderr, "panic (-p) incompatible with "
"other options\n");
usage();
@@ -883,7 +896,7 @@ main(int argc, char **argv)
if (argv[1] != NULL)
record.zi_type = atoi(argv[1]);
dataset[0] = '\0';
- } else if (record.zi_duration != 0) {
+ } else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) {
if (nowrites == 0) {
(void) fprintf(stderr, "-s or -g meaningless "
"without -I (ignore writes)\n");
@@ -937,6 +950,7 @@ main(int argc, char **argv)
return (1);
}
+ record.zi_cmd = ZINJECT_DATA_FAULT;
if (translate_record(type, argv[0], range, level, &record, pool,
dataset) != 0)
return (1);
diff --git a/usr/src/cmd/zlogin/Makefile b/usr/src/cmd/zlogin/Makefile
index e5c0c7db75..b498823b07 100644
--- a/usr/src/cmd/zlogin/Makefile
+++ b/usr/src/cmd/zlogin/Makefile
@@ -31,6 +31,8 @@ LDLIBS += -lsocket -lzonecfg -lcontract -lbrand -lsecdb
CFLAGS += $(CCVERBOSE)
FILEMODE = 0555
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/zlook/Makefile.com b/usr/src/cmd/zlook/Makefile.com
index 9afe89f00f..937842724d 100644
--- a/usr/src/cmd/zlook/Makefile.com
+++ b/usr/src/cmd/zlook/Makefile.com
@@ -34,6 +34,8 @@ CFLAGS += -g $(CCVERBOSE)
CFLAGS64 += -g $(CCVERBOSE)
CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS)
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/zoneadm/Makefile b/usr/src/cmd/zoneadm/Makefile
index 30e91714d8..15cbf5c68e 100644
--- a/usr/src/cmd/zoneadm/Makefile
+++ b/usr/src/cmd/zoneadm/Makefile
@@ -41,6 +41,8 @@ POFILES= $(OBJS:%.o=%.po)
LDLIBS += -lzonecfg -lsocket -lgen -lpool -lzfs -luuid -lnvpair -lbrand -ldladm -lsecdb
+CERRWARN += -_gcc=-Wno-uninitialized
+
.KEEP_STATE:
all: $(PROG) $(SCRIPTS)
diff --git a/usr/src/cmd/zoneadmd/Makefile b/usr/src/cmd/zoneadmd/Makefile
index 4c3c697a9d..fd2460664b 100644
--- a/usr/src/cmd/zoneadmd/Makefile
+++ b/usr/src/cmd/zoneadmd/Makefile
@@ -36,6 +36,14 @@ clean := TARGET = clean
clobber := TARGET = clobber
lint := TARGET = lint
+CFLAGS += $(CCVERBOSE)
+CERRWARN += -_gcc=-Wno-switch
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-uninitialized
+
+LDLIBS += -lsocket -lzonecfg -lnsl -ldevinfo -ldevice -lnvpair \
+ -lgen -lbsm -lcontract -lzfs -luuid -lbrand -ldladm -ltsnet -ltsol \
+ -linetutil
XGETFLAGS += -a -x zoneadmd.xcl
ROOTUSRLIBZONES = $(ROOT)/usr/lib/zones
diff --git a/usr/src/cmd/zonecfg/Makefile b/usr/src/cmd/zonecfg/Makefile
index 5c824ce759..3efc6bb40b 100644
--- a/usr/src/cmd/zonecfg/Makefile
+++ b/usr/src/cmd/zonecfg/Makefile
@@ -41,6 +41,11 @@ CPPFLAGS += -I.
LDFLAGS += $(MAPOPTS)
CLEANFILES += zonecfg_lex.c zonecfg_grammar.tab.c zonecfg_grammar.tab.h
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-unused-variable
+CERRWARN += -_gcc=-Wno-implicit-function-declaration
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/zonestat/zonestat/Makefile b/usr/src/cmd/zonestat/zonestat/Makefile
index 2f4681b1ed..1caf1a8218 100644
--- a/usr/src/cmd/zonestat/zonestat/Makefile
+++ b/usr/src/cmd/zonestat/zonestat/Makefile
@@ -28,8 +28,10 @@ OBJS = $(SRCS:%.c=%.o)
include ../../Makefile.cmd
-LDLIBS += -lscf -lzonestat -lumem
-LINTFLAGS += -u
+LDLIBS += -lscf -lzonestat -lumem
+LINTFLAGS += -u
+
+CERRWARN += -_gcc=-Wno-uninitialized
.KEEP_STATE:
diff --git a/usr/src/cmd/zonestat/zonestatd/Makefile b/usr/src/cmd/zonestat/zonestatd/Makefile
index d8a13af002..833103e197 100644
--- a/usr/src/cmd/zonestat/zonestatd/Makefile
+++ b/usr/src/cmd/zonestat/zonestatd/Makefile
@@ -36,10 +36,14 @@ SRCS = zonestatd.c
CPPFLAGS += -I$(ADJUNCT_PROTO)/usr/include/libxml2
LDLIBS += -lkstat -lpool -lexacct -lscf \
-lcontract -lcmdutils -lumem
+CPPFLAGS += -I/usr/include/libxml2
-LINTFLAGS += -u
+LINTFLAGS += -u
+CERRWARN += -_gcc=-Wno-parentheses
+CERRWARN += -_gcc=-Wno-unused-label
+CERRWARN += -_gcc=-Wno-uninitialized
-OBJS = $(SRCS:%.c=%.o)
+OBJS = $(SRCS:%.c=%.o)
.KEEP_STATE:
diff --git a/usr/src/cmd/zpool/Makefile b/usr/src/cmd/zpool/Makefile
index 0bf7b02767..0c0132d075 100644
--- a/usr/src/cmd/zpool/Makefile
+++ b/usr/src/cmd/zpool/Makefile
@@ -48,6 +48,10 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-unused-function
+CERRWARN += -_gcc=-Wno-uninitialized
+CERRWARN += -_gcc=-Wno-parentheses
+
ROOTUSRSBINLINKS = $(PROG:%=$(ROOTUSRSBIN)/%)
.KEEP_STATE:
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index 8e6d6b337e..b2e3acdc3c 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -239,7 +239,7 @@ get_usage(zpool_help_t idx) {
case HELP_REMOVE:
return (gettext("\tremove <pool> <device> ...\n"));
case HELP_REOPEN:
- return (""); /* Undocumented command */
+ return (gettext("\treopen <pool>\n"));
case HELP_SCRUB:
return (gettext("\tscrub [-s] <pool> ...\n"));
case HELP_STATUS:
@@ -3277,7 +3277,7 @@ zpool_do_split(int argc, char **argv)
if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
zpool_enable_datasets(zhp, mntopts, 0) != 0) {
ret = 1;
- (void) fprintf(stderr, gettext("Split was succssful, but "
+ (void) fprintf(stderr, gettext("Split was successful, but "
"the datasets could not all be mounted\n"));
(void) fprintf(stderr, gettext("Try doing '%s' with a "
"different altroot\n"), "zpool import");
@@ -3556,22 +3556,37 @@ zpool_do_reguid(int argc, char **argv)
* zpool reopen <pool>
*
* Reopen the pool so that the kernel can update the sizes of all vdevs.
- *
- * NOTE: This command is currently undocumented. If the command is ever
- * exposed then the appropriate usage() messages will need to be made.
*/
int
zpool_do_reopen(int argc, char **argv)
{
+ int c;
int ret = 0;
zpool_handle_t *zhp;
char *pool;
+ /* check options */
+ while ((c = getopt(argc, argv, "")) != -1) {
+ switch (c) {
+ case '?':
+ (void) fprintf(stderr, gettext("invalid option '%c'\n"),
+ optopt);
+ usage(B_FALSE);
+ }
+ }
+
argc--;
argv++;
- if (argc != 1)
- return (2);
+ if (argc < 1) {
+ (void) fprintf(stderr, gettext("missing pool name\n"));
+ usage(B_FALSE);
+ }
+
+ if (argc > 1) {
+ (void) fprintf(stderr, gettext("too many arguments\n"));
+ usage(B_FALSE);
+ }
pool = argv[0];
if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL)
diff --git a/usr/src/cmd/zstreamdump/Makefile b/usr/src/cmd/zstreamdump/Makefile
index 26944be2fb..5b7e6b79c1 100644
--- a/usr/src/cmd/zstreamdump/Makefile
+++ b/usr/src/cmd/zstreamdump/Makefile
@@ -45,6 +45,8 @@ $(NOT_RELEASE_BUILD)CPPFLAGS += -DDEBUG
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-switch
+
.KEEP_STATE:
.PARALLEL:
diff --git a/usr/src/cmd/ztest/Makefile.com b/usr/src/cmd/ztest/Makefile.com
index 0f308ab2e3..6126853ba0 100644
--- a/usr/src/cmd/ztest/Makefile.com
+++ b/usr/src/cmd/ztest/Makefile.com
@@ -46,6 +46,8 @@ CPPFLAGS += -D_LARGEFILE64_SOURCE=1 -D_REENTRANT $(INCS) -DDEBUG
LINTFLAGS += -xerroff=E_NAME_DEF_NOT_USED2
LINTFLAGS64 += -xerroff=E_NAME_DEF_NOT_USED2
+CERRWARN += -_gcc=-Wno-switch
+
.KEEP_STATE:
all: $(PROG)
diff --git a/usr/src/cmd/ztest/ztest.c b/usr/src/cmd/ztest/ztest.c
index 95b8e2ed79..3da6723459 100644
--- a/usr/src/cmd/ztest/ztest.c
+++ b/usr/src/cmd/ztest/ztest.c
@@ -119,8 +119,8 @@
#include <sys/fs/zfs.h>
#include <libnvpair.h>
-#define ZTEST_FD_DATA 3
-#define ZTEST_FD_RAND 4
+static int ztest_fd_data = -1;
+static int ztest_fd_rand = -1;
typedef struct ztest_shared_hdr {
uint64_t zh_hdr_size;
@@ -708,14 +708,17 @@ process_options(int argc, char **argv)
UINT64_MAX >> 2);
if (strlen(altdir) > 0) {
- char cmd[MAXNAMELEN];
- char realaltdir[MAXNAMELEN];
+ char *cmd;
+ char *realaltdir;
char *bin;
char *ztest;
char *isa;
int isalen;
- (void) realpath(getexecname(), cmd);
+ cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
+ realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
+
+ VERIFY(NULL != realpath(getexecname(), cmd));
if (0 != access(altdir, F_OK)) {
ztest_dump_core = B_FALSE;
fatal(B_TRUE, "invalid alternate ztest path: %s",
@@ -746,6 +749,9 @@ process_options(int argc, char **argv)
fatal(B_TRUE, "invalid alternate lib directory %s",
zo->zo_alt_libpath);
}
+
+ umem_free(cmd, MAXPATHLEN);
+ umem_free(realaltdir, MAXPATHLEN);
}
}
@@ -762,10 +768,12 @@ ztest_random(uint64_t range)
{
uint64_t r;
+ ASSERT3S(ztest_fd_rand, >=, 0);
+
if (range == 0)
return (0);
- if (read(ZTEST_FD_RAND, &r, sizeof (r)) != sizeof (r))
+ if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r))
fatal(1, "short read from /dev/urandom");
return (r % range);
@@ -4695,7 +4703,18 @@ ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
if (islog)
(void) rw_unlock(&ztest_name_lock);
} else {
+ /*
+ * Ideally we would like to be able to randomly
+ * call vdev_[on|off]line without holding locks
+ * to force unpredictable failures but the side
+ * effects of vdev_[on|off]line prevent us from
+ * doing so. We grab the ztest_vdev_lock here to
+ * prevent a race between injection testing and
+ * aux_vdev removal.
+ */
+ VERIFY(mutex_lock(&ztest_vdev_lock) == 0);
(void) vdev_online(spa, guid0, 0, NULL);
+ VERIFY(mutex_unlock(&ztest_vdev_lock) == 0);
}
}
@@ -5650,20 +5669,16 @@ ztest_init(ztest_shared_t *zs)
}
static void
-setup_fds(void)
+setup_data_fd(void)
{
- int fd;
-
- char *tmp = tempnam(NULL, NULL);
- fd = open(tmp, O_RDWR | O_CREAT, 0700);
- ASSERT3U(fd, ==, ZTEST_FD_DATA);
- (void) unlink(tmp);
- free(tmp);
+ static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX";
- fd = open("/dev/urandom", O_RDONLY);
- ASSERT3U(fd, ==, ZTEST_FD_RAND);
+ ztest_fd_data = mkstemp(ztest_name_data);
+ ASSERT3S(ztest_fd_data, >=, 0);
+ (void) unlink(ztest_name_data);
}
+
static int
shared_data_size(ztest_shared_hdr_t *hdr)
{
@@ -5685,10 +5700,10 @@ setup_hdr(void)
ztest_shared_hdr_t *hdr;
hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
- PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
+ PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
ASSERT(hdr != MAP_FAILED);
- VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, sizeof (ztest_shared_hdr_t)));
+ VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t)));
hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t);
hdr->zh_opts_size = sizeof (ztest_shared_opts_t);
@@ -5699,7 +5714,7 @@ setup_hdr(void)
hdr->zh_ds_count = ztest_opts.zo_datasets;
size = shared_data_size(hdr);
- VERIFY3U(0, ==, ftruncate(ZTEST_FD_DATA, size));
+ VERIFY3U(0, ==, ftruncate(ztest_fd_data, size));
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
}
@@ -5712,14 +5727,14 @@ setup_data(void)
uint8_t *buf;
hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
- PROT_READ, MAP_SHARED, ZTEST_FD_DATA, 0);
+ PROT_READ, MAP_SHARED, ztest_fd_data, 0);
ASSERT(hdr != MAP_FAILED);
size = shared_data_size(hdr);
(void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()),
- PROT_READ | PROT_WRITE, MAP_SHARED, ZTEST_FD_DATA, 0);
+ PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
ASSERT(hdr != MAP_FAILED);
buf = (uint8_t *)hdr;
@@ -5738,12 +5753,13 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
{
pid_t pid;
int status;
- char cmdbuf[MAXPATHLEN];
+ char *cmdbuf = NULL;
pid = fork();
if (cmd == NULL) {
- (void) strlcpy(cmdbuf, getexecname(), sizeof (cmdbuf));
+ cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
+ (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN);
cmd = cmdbuf;
}
@@ -5752,9 +5768,16 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
if (pid == 0) { /* child */
char *emptyargv[2] = { cmd, NULL };
+ char fd_data_str[12];
struct rlimit rl = { 1024, 1024 };
(void) setrlimit(RLIMIT_NOFILE, &rl);
+
+ (void) close(ztest_fd_rand);
+ VERIFY3U(11, >=,
+ snprintf(fd_data_str, 12, "%d", ztest_fd_data));
+ VERIFY0(setenv("ZTEST_FD_DATA", fd_data_str, 1));
+
(void) enable_extended_FILE_stdio(-1, -1);
if (libpath != NULL)
VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1));
@@ -5763,6 +5786,11 @@ exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
fatal(B_TRUE, "exec failed: %s", cmd);
}
+ if (cmdbuf != NULL) {
+ umem_free(cmdbuf, MAXPATHLEN);
+ cmd = NULL;
+ }
+
while (waitpid(pid, &status, 0) != pid)
continue;
if (statusp != NULL)
@@ -5827,39 +5855,41 @@ main(int argc, char **argv)
char timebuf[100];
char numbuf[6];
spa_t *spa;
- char cmd[MAXNAMELEN];
+ char *cmd;
boolean_t hasalt;
-
- boolean_t ischild = (0 == lseek(ZTEST_FD_DATA, 0, SEEK_CUR));
- ASSERT(ischild || errno == EBADF);
+ char *fd_data_str = getenv("ZTEST_FD_DATA");
(void) setvbuf(stdout, NULL, _IOLBF, 0);
dprintf_setup(&argc, argv);
- if (!ischild) {
+ ztest_fd_rand = open("/dev/urandom", O_RDONLY);
+ ASSERT3S(ztest_fd_rand, >=, 0);
+
+ if (!fd_data_str) {
process_options(argc, argv);
- setup_fds();
+ setup_data_fd();
setup_hdr();
setup_data();
bcopy(&ztest_opts, ztest_shared_opts,
sizeof (*ztest_shared_opts));
} else {
+ ztest_fd_data = atoi(fd_data_str);
setup_data();
bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts));
}
ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count);
/* Override location of zpool.cache */
- (void) asprintf((char **)&spa_config_path, "%s/zpool.cache",
- ztest_opts.zo_dir);
+ VERIFY3U(asprintf((char **)&spa_config_path, "%s/zpool.cache",
+ ztest_opts.zo_dir), !=, -1);
ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t),
UMEM_NOFAIL);
zs = ztest_shared;
- if (ischild) {
+ if (fd_data_str) {
metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang;
metaslab_df_alloc_threshold =
zs->zs_metaslab_df_alloc_threshold;
@@ -5882,7 +5912,8 @@ main(int argc, char **argv)
(u_longlong_t)ztest_opts.zo_time);
}
- (void) strlcpy(cmd, getexecname(), sizeof (cmd));
+ cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
+ (void) strlcpy(cmd, getexecname(), MAXNAMELEN);
zs->zs_do_init = B_TRUE;
if (strlen(ztest_opts.zo_alt_ztest) != 0) {
@@ -6023,5 +6054,7 @@ main(int argc, char **argv)
kills, iters - kills, (100.0 * kills) / MAX(1, iters));
}
+ umem_free(cmd, MAXNAMELEN);
+
return (0);
}