Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

minor fallout from GCC 4.8.3



Just tried to compile a new kernel for an HP microserver and pulled the environment driver w83795g into the kernel config. The compile fails with a 'statement with no effect' error:

#   compile  HP/w83795g.o
/usr/tools/bin/x86_64--netbsd-gcc -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -mno-avx -msoft-float -ffreestanding -fno-zero-initialized-in-bss -O2 -fno -omit-frame-pointer -fstack-protector -Wstack-protector --param ssp-buffer-size=1 -fno-strict-aliasing -fno-common -std=gnu99 -Werror -Wall -Wno-main -Wno-f ormat-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wold-style-definition -Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wno-unreach able-code -Wno-pointer-sign -Wno-attributes -Wextra -Wno-unused-parameter -Wold-style-definition -Wno-sign-compare --sysroot=/usr/obj/destdir.amd64 -Damd64 -Dx86_64 -I. -I/usr/src/sys/../common/include -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DDIAGNOSTIC -DMAXUSERS=64 -D_KERNEL -D_KERNEL_OPT -std=gnu99 -I/ usr/src/sys/lib/libkern/../../../common/lib/libc/quad -I/usr/src/sys/lib/libkern/../../../common/lib/libc/string -I/usr/src/sys/lib/libkern/../../../common/ lib/libc/arch/x86_64/string -D_FORTIFY_SOURCE=2 -I/usr/src/sys/external/bsd/ipf -I/usr/src/sys/external/isc/atheros_hal/dist -I/usr/src/sys/external/isc/ath eros_hal/ic -I/usr/src/sys/external/bsd/drm/dist/bsd-core -I/usr/src/sys/external/bsd/drm/dist/shared-core -I/usr/src/sys/../common/include -I/usr/src/sys/e
xternal/bsd/acpica/dist/include -c /usr/src/sys/dev/i2c/w83795g.c
/usr/src/sys/dev/i2c/w83795g.c: In function 'w83795g_get_limits':
/usr/src/sys/dev/i2c/w83795g.c:342:4: error: statement with no effect [-Werror=unused-value]
    lsb >> 4;
    ^
cc1: all warnings being treated as errors
*** [w83795g.o] Error code 1

Fix below:

$ diff -u /usr/src/sys/dev/i2c/w83795g.c.orig /usr/src/sys/dev/i2c/w83795g.c
--- /usr/src/sys/dev/i2c/w83795g.c.orig 2014-04-13 12:14:39.000000000 +0100
+++ /usr/src/sys/dev/i2c/w83795g.c      2014-04-13 11:08:33.000000000 +0100
@@ -339,7 +339,7 @@
index = W83795G_FHL1LSB + (sensor->msb - W83795G_FANIN1) / 2; iic_smbus_read_byte(sc->sc_tag, sc->sc_addr, index, &lsb, 0);
                if (index % 2)
-                       lsb >> 4;
+                       lsb = lsb >> 4;
                else
                        lsb &= 0xf;
                limits->sel_warnmin = 1350000 / (msb << 4 | lsb);


Can someone apply this to HEAD please.

Cheers,
Dave

--
============================================
Phone: 07805784357
Open Source O/S: www.netbsd.org
Caving: http://www.wirralcavinggroup.org.uk
============================================



Home | Main Index | Thread Index | Old Index