From owner-freebsd-hackers Tue Nov 7 18:24:56 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from saturn.cs.uml.edu (saturn.cs.uml.edu [129.63.8.2]) by hub.freebsd.org (Postfix) with ESMTP id 5750F37B479 for ; Tue, 7 Nov 2000 18:24:50 -0800 (PST) Received: (from acahalan@localhost) by saturn.cs.uml.edu (8.11.0/8.10.0) id eA82Nxf392522; Tue, 7 Nov 2000 21:23:59 -0500 (EST) Date: Tue, 7 Nov 2000 21:23:59 -0500 (EST) Message-Id: <200011080223.eA82Nxf392522@saturn.cs.uml.edu> From: "Albert D. Cahalan" To: hackers@FreeBSD.ORG, roam@orbitel.bg, keramida@ceid.upatras.gr Subject: Re: umask(2) and -Wconversion Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Peter Pentchev writes: > As you can see, I'm passing a short i as a first arg, a short f > as second, and a short b as third; and yet, gcc with BDECFLAGS > complains about ALL the arguments! Yes, no kidding. That's what you asked gcc to do. `-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. The C language is crufty. In the absense of a prototype, "short" is promoted to "int". You wanted to be warned about that; you got it! To avoid the warning, avoid passing anything but "int" and "double". Maybe "long" is OK too, I forget. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message