From owner-cvs-all@FreeBSD.ORG Mon Jun 28 21:32:43 2004 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 837C416A4CE; Mon, 28 Jun 2004 21:32:43 +0000 (GMT) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1094743D41; Mon, 28 Jun 2004 21:32:43 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.10/8.12.10) with ESMTP id i5SLVuqM004823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Jun 2004 17:31:56 -0400 (EDT) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id i5SLVp76003134; Mon, 28 Jun 2004 17:31:51 -0400 (EDT) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16608.36423.596831.48148@grasshopper.cs.duke.edu> Date: Mon, 28 Jun 2004 17:31:51 -0400 (EDT) To: Brian Fundakowski Feldman In-Reply-To: <20040628201821.GA23618@green.homeunix.org> References: <200406281915.i5SJFeaV060231@repoman.freebsd.org> <20040628152232.A2977@grasshopper.cs.duke.edu> <20040628193858.GG5635@green.homeunix.org> <16608.30892.745161.730935@grasshopper.cs.duke.edu> <20040628201821.GA23618@green.homeunix.org> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm vm_map.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Jun 2004 21:32:43 -0000 Brian Fundakowski Feldman writes: > > GCC not actually type-checking here is certainly a bug from my > viewpoint and one whose existence makes me more than a little > worried about further problems with min() and friends (ones that > I did not introduced ;). Are there any GCC experts that can help > out, here? > -Wconversion would find this.. -Wconversion Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype. This includes conversions of fixed point to floating and vice versa, and conversions changing the width or signedness of a fixed point argument except when the same as the default promotion. However its a little bit too restrictive, as it complains about any mismatch and the compile doesn't get even one C file done before erroring out. If I add -Wconversion to my cflags, it first trips on sys/bus.h (harmless passing of "1" to a function taking a long), and then it pukes all over atomic.h: In file included from ../../../sys/systm.h:41, from ../../../cam/cam.c:35: machine/atomic.h: In function `atomic_set_acq_8': machine/atomic.h:308: warning: passing arg 2 of `atomic_set_8' with different width due to prototype machine/atomic.h: In function `atomic_set_rel_8': machine/atomic.h:308: warning: passing arg 2 of `atomic_set_8' with different width due to prototype Any idea what its problem is? Drew PS: What we want is something like -msg_enable level6 on the compaq compiler, which just warns about truncations: cc: Info: foo.c, line 14: In this statement, "l" has a larger data size than "int". Assignment might result in data loss. (truncintasn)