From owner-freebsd-hackers Fri Jul 27 12:48:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.rpi.edu (mail.rpi.edu [128.113.22.40]) by hub.freebsd.org (Postfix) with ESMTP id 4FEA737B403; Fri, 27 Jul 2001 12:48:21 -0700 (PDT) (envelope-from drosih@rpi.edu) Received: from [128.113.24.47] (gilead.acs.rpi.edu [128.113.24.47]) by mail.rpi.edu (8.11.3/8.11.3) with ESMTP id f6RJmKf15050; Fri, 27 Jul 2001 15:48:20 -0400 Mime-Version: 1.0 X-Sender: drosih@mail.rpi.edu Message-Id: In-Reply-To: <5lg0bimtg3.fsf@assaris.sics.se> References: <89312.996234085@axl.seasidesoftware.co.za> <5lg0bimtg3.fsf@assaris.sics.se> Date: Fri, 27 Jul 2001 15:48:18 -0400 To: Assar Westerlund , Sheldon Hearn From: Garance A Drosihn Subject: Re: -Wconversion and mode_t Cc: hackers@FreeBSD.ORG Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 2:45 PM +0200 7/27/01, Assar Westerlund wrote: >Sheldon Hearn writes: >> How on earth is one supposed to shut up the -Wconversion warnings >> generated for all the functions that take mode_t arguments? >> >> I've tried every sane typecast I can think of to prove to the compiler >> that I know what I'm doing, but it won't shut up. >> >> /usr/src/usr.sbin/config is a good example. Its Makefile sets >> BDECFLAGS, which includes -Wconversion. > >IMHO, -Wconversion is bogus in an ANSI/ISO world and trying to rewrite >code to avoid those warnings is not useful. I asked BruceDE about this very thing recently. Basically, for the case of mode_t you can not avoid that warning when including the prototype for the function. The warning has to do with the parameter being an unsigned-short, and how that is treated with a prototype vs how it is treated without a prototype. In the case of mode_t it's mainly just irritating, but there are other situations where Bruce felt the -Wconversion checking was useful. Bruce was thinking that maybe there should be some other warning option which provided the useful checking without triggering so many warnings which are unnecessary in our environment. -- Garance Alistair Drosehn = gad@eclipse.acs.rpi.edu Senior Systems Programmer or gad@freebsd.org Rensselaer Polytechnic Institute or drosih@rpi.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message