Date: Thu, 10 Aug 2000 08:50:32 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Lets Go Canes! cc: djgpp AT delorie DOT com Subject: Re: Conversion warnings In-Reply-To: <200008092306.TAA18952@websmtp1.bellsouth.bigfoot.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 9 Aug 2000, Lets Go Canes! wrote: > gcc -Wconversion -c test.c > test.c: In function `main': > test.c:11: warning: passing arg 1 of `f' as `float' rather than `double' due to prototype > test.c:11: warning: passing arg 2 of `f' with different width due to prototype These are the warnings you asked for with -Wconversion. The essense of the warning is this: GCC tells you that any code which does not have the prototype visible at compile time will work incorrectly. The reason is that C, by default, promotes all float variables to double and all char variables to int, when passing them to functions. To make those warnings go away, change the definition of `f' so that it accepts double and int rather than float and char. Then the code will work even without the prototype.