Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Oct 2008 13:44:14 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        current@freebsd.org
Subject:   Parenthesizing problem in sys/i386/i386/identcpu.c
Message-ID:  <20081022204414.GR11652@bunrab.catwhisker.org>

next in thread | raw e-mail | index | archive | help

--80Ds8Z/hZmemMosa
Content-Type: multipart/mixed; boundary="E1BPhOSoTthPQdPL"
Content-Disposition: inline


--E1BPhOSoTthPQdPL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

This was from around line 847; whine I saw was:

>>> Kernel build for FREEBEAST started on Wed Oct 22 12:50:05 PDT 2008
=2E..
>>> stage 3.2: building everything
=2E..
cc -c -O -pipe  -std=3Dc99 -g -Wall -Wredundant-decls -Wnested-externs -Wst=
rict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual =
 -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc  -I. -I/usr/src/sy=
s -I/usr/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -inclu=
de opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-growt=
h=3D100 --param large-function-growth=3D1000  -mno-align-long-strings -mpre=
ferred-stack-boundary=3D2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3=
 -ffreestanding -fstack-protector -Werror  /usr/src/sys/i386/i386/identcpu.c
cc1: warnings being treated as errors
/usr/src/sys/i386/i386/identcpu.c: In function 'printcpuinfo':
/usr/src/sys/i386/i386/identcpu.c:847: warning: suggest parentheses around =
&& within ||
/usr/src/sys/i386/i386/identcpu.c:847: error: expected statement before ')'=
 token
*** Error code 1

Stop in /common/S4/obj/usr/src/sys/FREEBEAST.
*** Error code 1

Stop in /usr/src.
[End of excerpt...]

The attached patch got me through the buildkernel, and the resulting
kernel booted OK -- for me.  I'm only using the i386 arch; I don't
know if there might be similar issues for any other arch.

It applied to rev. 1.190 of src/sys/i386/i386/identcpu.c.  (Sorry; I'm
still reading about Subversion, and haven't got my thinking converted
yet.)

Peace,
david
--=20
David H. Wolfskill				david@catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

--E1BPhOSoTthPQdPL
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="identcpu.c.diff"
Content-Transfer-Encoding: quoted-printable

Index: sys/i386/i386/identcpu.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/freebsd/src/sys/i386/i386/identcpu.c,v
retrieving revision 1.190
diff -u -r1.190 identcpu.c
--- sys/i386/i386/identcpu.c	22 Oct 2008 00:01:53 -0000	1.190
+++ sys/i386/i386/identcpu.c	22 Oct 2008 20:10:15 -0000
@@ -841,10 +841,10 @@
 			    "AuthenticAMD") =3D=3D 0)
 				cpu_feature &=3D ~CPUID_HTT;
=20
-			if (!tsc_is_invariant &&
-			    (strcmp(cpu_vendor, "AuthenticAMD") =3D=3D 0 &&
-			    (amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0 ||
-			    I386_CPU_FAMILY(cpu_id) >=3D 0x10))) {
+			if ((!tsc_is_invariant &&
+			    strcmp(cpu_vendor, "AuthenticAMD") =3D=3D 0 &&
+			    (amd_pminfo & AMDPM_TSC_INVARIANT) !=3D 0) ||
+			    I386_CPU_FAMILY(cpu_id) >=3D 0x10) {
 				tsc_is_invariant =3D 1;
 				printf("\n  P-state invariant TSC");
 			}

--E1BPhOSoTthPQdPL--

--80Ds8Z/hZmemMosa
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (FreeBSD)

iEYEARECAAYFAkj/kJ4ACgkQmprOCmdXAD1ctQCdHvoSUeRloGmKdN3pv+QVUcKw
yy8AnRnJMB1cLylDlZ4rCv24YNjc6Vzz
=tQtp
-----END PGP SIGNATURE-----

--80Ds8Z/hZmemMosa--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081022204414.GR11652>